hi every body
I need to creat a editor text like DOS with conio.h I need to know how to creat a
small screen the exemple is in picture please help me
hi every body
I need to creat a editor text like DOS with conio.h I need to know how to creat a
small screen the exemple is in picture please help me
What exactly is your problem? That screen is made by printing characters of different color. Using gotoxy() and cprintf() as well as the color changing functions you should be able to do it.
Here's a table of cp437 characters which can be helpful: http://www-poleia.lip6.fr/~jfp/inalc.../img/cp437.gif
hello
yes but what's the code for create the small screen.?
thank you very much
OKthanks
I have a signature that I like.
If you have specific help that you need with code that you wrote, we can help.
These are the text mode routines in Borland's early (and now free), compiler:
clreol - Clears from the cursor to the end of the line
clrscr - clears the crurrent text window
deline - deletes the line, lower lines are moved up
gettext - copies a rect. area of the text screen to an off-screen buffer
gettextinfo - returns info re: the current text mode, window location, and cursor location
gotoxy - moves cursor to the specified column and row in the current text window
highvideo - selects high intensity (bold) video char's.
insline - inserts a blank line in the current text window at the cursor's location. Other lines are pushed downward.
lowvideo - selects low intensity video char's.
movetext - copies text from one part of the screen to another
normvideo - selects normal intensity video char's
_setcursortype - sets the cursor's shape
textattr - sets the attribute (foreground & background colors) for subsequent text output
textbackground - selects a new background color for text display
textcolor - selects a new foreground color for text display
textmode - puts display adaptor into a selected text mode
wherex - returns the x position of the cursor in the current text window
wherey - same, but the y position
window - defines a text window, to hold all future text output.
Obviously, window is one critical function you'll want.
You can define a window with this code fragment:
This bit of code will display four windows on the screen:Code:window(10,10,69,14); /* defines the text window */ gotoxy(30,2); cputs("hello!");
The above should (if I haven't borked the keyboarding of it) run on early Borland compilers.Code:#include <conio.h> int main() { int xsize = 15; int ysize = 7; int xorg, yorg; xorg = yorg = 0; int i; for (i = 0; i < 4; i++) { xorg += 5; yorg += 3; textattr(WHITE + ((i + 1) << 4)); window(xorg, yorg, xorg+xsize - 1, yorg + ysize - 1); clrscr(); gotoxy(1,1); cprintf("This is window number %d", i); } return 0; }
Adak
Last edited by Adak; 05-17-2007 at 04:40 PM.
thank you very much
but I can't compile this with DEV-C++ because DEV-C++ don't know gotoxy and window textattr
If your compiler doesn't come with conio.h, then you can't use it. Your options are mainly:
- find a compiler like Borland that supports conio.h
- find a library that supports these functions (I think the curses library does.)
- write the functionality using the Win32 API.
I find a library conio.h
but when I compile I find 2 error
1- error C2065: 'yorg' : undeclared identifier
2- error C2065: 'window' : undeclared identifier
If it didn't come with the compiler, you can't use it.
Are you sure you copied all the code properly from the example? The first error sounds like you missed declaring the variable. The second looks like you might have accidentally used window() as a variable instead of a function, but I'm guessing.
yes I copied all the code properly from the example?
and the library which I give the library which I use
I see I made an error in my typing on the program for yorg. Ooops!
I'll fix that with an edit of it.
You can run Borland's C compiler/IDE in WindowsXP, easily, and it's free from the Borland legacy website. Just download it and fire it up.
I don't know anything about DEV-C, so I can't help you there.
Don't you have a windows system to run Borland's compiler and IDE?
I just looked through your conio.h. It shows a gotoxy() function, but it may be defined in another header, What does your help/man page show for it?
I'd change to Borland to do this. Is that feasable?
Adak
Last edited by Adak; 05-17-2007 at 04:56 PM.
No sorry I don't have I'm a student and in scool we use DEV-C
thank you adak
I will try with Borland's C compiler/IDE