473,473 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

menu item selection question...?

/* menu.c, bc 5.02/tc 3, winxp */

#include <stdio.h>
#include <conio.h>

#define uaro 72
#define daro 80

/* plz help me in this logic, how can i modify this my program
of a simple menu so that when i press down arrow key it
makes previous items bgcolor black and fgcolor white and
selected items bgcolor red and fgcolor white and vice versa
and when i press enter it should call respective function
this should keep going on untill i press enter on exit menu item...?!
plz help me in this regard. */

void item1()
{
clrscr();

printf(" in item 1 ");

}

void item2()
{
clrscr();

printf(" in item 2 ");

}

void item3()
{
clrscr();

printf(" in item 3 ");

}

int main()
{
int c=0, x=10, y=10, red=4,wite=15; char cho;

clrscr();

gotoxy(x,y);
textattr(wite+ (red<<4) );
cprintf("Item 1");

gotoxy(10, y+=2);
textattr(15+(0<<4) );
cprintf("Item 2");

gotoxy(10,y+=2);
textattr(15+(0<<4) );
cprintf("Item 3");

gotoxy(x,y-=4);

while(1)
{
c=getch();

switch( c )
{
case daro:
if(y==14)
gotoxy(x, 14);
else
gotoxy(x, y+=2);
break;
case uaro:
if(y==10)
gotoxy(x,10);
else
gotoxy(x,y-=2);
break;
default:
break;
}
}
return 0;

}

/* thanx a lot,

mujeebrm */
Nov 17 '05 #1
1 882
Hi mujeebrm!
/* plz help me in this logic, how can i modify this my program
[...]
clrscr();
[...]
gotoxy(x,y);


This newsgroup is mainly for windows programming and in special for
managed C++.
Please try a borland (DOS) forum.

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2

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

Similar topics

13
by: Matthew Hagston | last post by:
Trying to do some updating and beyond frustrations with making it compatibal with Mac's I am primarily done. Biggest problem I am having now is with Opera not displaying the menu. works fine in IE,...
0
by: web1110 | last post by:
I have a menu layout like this: Navigate | |----- Reference | |----- Back If I click on Navigate and move the cursor to Back, the Back select event generates a list of 3rd level menu items...
1
by: desjardins.daniel | last post by:
Hi ! Excuse my english, i'm a french canadien... So here my message : I have put on my site a photo gallery and at the right a nav menu. This menu has a red dot visible want someone is passing...
4
by: fizzyfozzy | last post by:
Hi, I am trying to figure out how to show or hide a selection of divs on my page depending on what is selected from a list/menu item, using css & javascript. I have tried to use the script...
2
by: Gary Wessle | last post by:
Hi I need help organizing this program in the right way. I included the code below which compiles and runs and gives the desired effect to a certain point, but I don't know what the next step...
0
by: Gary Wessle | last post by:
Hi The program I am trying to make is a basic one, it provides a command line menu to the user and accepts the choice given by the user selection from the main menu. it then spawns a new thread...
0
by: benfly08 | last post by:
Hi, I used SWT to develop an windows application. In the application there is a dynamic created popup menu. The dynamic part is that i will pass a list of name to be a submenu of one menu item....
1
by: Kayvine | last post by:
Hi guys, this is a question I have for an assignment, it is pretty long, but I am not asking for the code(well if someone wants to write I'll be really happy, lol), but I just want to know how to...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.