473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

[C++] Drawing a window border with asterisks

Hello, I am just wondering if there is an easy way to do the following
in my constructor

IOScreen(int row, int col, int width, int height); sets the row, col,
width, height attributes of the IOScreen to the corresponding incoming
values in the argument list. If an IOScreen is made using this
constructor, it means that the IOScreen window is not a full-screen
size window. (i.e it will only cover the screen partially and when it
is displayed, it will show a frame using the asterisk character on the
border line characters of the window

I assume Ill want to use my row, col, width and height in some kind of
for loop to make the border line characters of the window but am unsure
of the conditions to do so. Appreciate any help whatsoever.

Thanks in advance.

Edit: Think I forgot to mention that I can use a function I wrote
called cio_cursor

/* Places cursor at specified row/column number */
void cio_cursor(int row, int column);

So far I have got

IOScreen::IOScreen(int row, int col, int width, int height){
this->row = row;
this->col = col;
this->width = width;
this->height = height;
cio_start();
cio_cursor(row,col);
// Adjust window settings for this constructor using width and height
}

Nov 22 '05 #1
1 5163
"AMT2K5" <Aa*********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello, I am just wondering if there is an easy way to do the following
in my constructor

IOScreen(int row, int col, int width, int height); sets the row, col,
width, height attributes of the IOScreen to the corresponding incoming
values in the argument list. If an IOScreen is made using this
constructor, it means that the IOScreen window is not a full-screen
size window. (i.e it will only cover the screen partially and when it
is displayed, it will show a frame using the asterisk character on the
border line characters of the window

I assume Ill want to use my row, col, width and height in some kind of
for loop to make the border line characters of the window but am unsure
of the conditions to do so. Appreciate any help whatsoever.

Thanks in advance.

Edit: Think I forgot to mention that I can use a function I wrote
called cio_cursor

/* Places cursor at specified row/column number */
void cio_cursor(int row, int column);

So far I have got

IOScreen::IOScreen(int row, int col, int width, int height){
this->row = row;
this->col = col;
this->width = width;
this->height = height;
cio_start();
cio_cursor(row,col);
// Adjust window settings for this constructor using width and height
}


Well, an asterisk box would look like:

******
* *
* *
******

So you just got to position to each of the asterisk positions and print a
'*'.
For the top and bottom you can build a string of "******" and just print
that if you want.

Otherwise, do a for loop for the first line for each asterisk, position to
that row at the top column, print an asterisk. Then for each other line
print an "*" in the left position and one in the right.
Then do the same thing you did for the top line for the bottom line.

I'm purposly being vague because I suspect this is homework. Also consider
the newsgroup alt.comp.lang.learn.c-c++
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Coburn's Grey Helmet Hair | last post by:
When I try to compile my GTK# app, the compiler says: jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -r -o buttons.exe error CS2001: Source file 'buttons.exe' could not...
19
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site....
1
by: stellabein | last post by:
Hi friends, I am very very new to programing. i have a one main window from that window i am opening one modal window using showmodaldialog(m.jp...). in that modal window i have a form. when i...
3
by: Paul | last post by:
Hi just wondering if there is an easy way to a box around a bunch of controls like ----------------------------------------------------- | control1 control2 control3 | | ...
10
by: tshad | last post by:
I have a problem setting the background color of textbox on the fly. I tried using: applicantID.backcolor = "F6F6F6" and applicantID.backcolor = "#F6F6F6"
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
1
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
15
by: javelin | last post by:
I need to be able to create a javascript based drawing/signature box, and be able to save it. Can someone refer me to a script that will allow this, or even a 3rd party package for sale? It can't...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.