473,405 Members | 2,354 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,405 software developers and data experts.

Help for designing outlines in c language

> Hi all this is Manmeet Mittal,
>I want to create menus and borders in c. How can make it. What r its codings.
Jul 17 '06 #1
11 1384
In article <11*********************@h48g2000cwc.googlegroups. com>,
Manmeet Mittal <ma************@yahoo.comwrote:
>> Hi all this is Manmeet Mittal,
I want to create menus and borders in c. How can make it. What r its codings.
The C language itself only provides for text, and not graphics.
If you were thinking of graphical menus (e.g., pop-up or drop-down
menus) then you need operating system dependant extensions and you should
ask about those in a newsgroup appropriate for your operating system.

Even if you were just thinking about text-only menus and borders,
you cannot portably do what you want in standard C, as C does not
have any notion of "screen" or font or how characters show up on displays.
C also does not have any notion of where things are on whatever
output device is being used, so you cannot portably position particular
information at particular locations.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Jul 17 '06 #2
"Manmeet Mittal" <ma************@yahoo.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
>> Hi all this is Manmeet Mittal,
I want to create menus and borders in c. How can make it. What r its
codings.
In the C language, there is no GUI defined.

DDJ had a character based interface a while ago:
http://www.ddj.com/showArticle.jhtml...leID=184408752

Probably, if you want something good looking and portable, you should look
into a tool like wxWidgets:
http://www.wxwidgets.org/
Jul 17 '06 #3
Manmeet Mittal wrote:
Hi all this is Manmeet Mittal,
I want to create menus and borders in c. How can make it. What r its codings.
#include <stdio.h>

int main(void)
{
int choice = 0;
while(choice != 4)
{
puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");
scanf("%d", &choice);
switch(choice)
{
case 1: puts("Adding"); break;
case 2: puts("Subtracting"); break;
case 3: puts("Multiplying"); break;
case 4: break;
default: puts("Invalid choice");
}
}
return 0;
}

--
Simon.
Jul 17 '06 #4
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>Manmeet Mittal wrote:
>I want to create menus and borders in c. How can make it. What r its codings.
puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");
That assumes a fixed width font, which is not a portable assumption.

It also assumes that the display is at least 26 wide by 8 high,
which is also not portable.
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Jul 17 '06 #5
Walter Roberson wrote:
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>Manmeet Mittal wrote:
>>I want to create menus and borders in c. How can make it. What r its codings.
> puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");

That assumes a fixed width font, which is not a portable assumption.

It also assumes that the display is at least 26 wide by 8 high,
which is also not portable.
Heck, it assumes *a* display, which is not portable. There's no way to do
"menus and borders" in the way the OP presumably intends in portable C, so
it hardly matters.

S.
Jul 17 '06 #6
Skarmander wrote:
There's no way to do "menus and borders" in the way the OP presumably
intends in portable C, so it hardly matters.
Necessary correction: there's no way to do it in portable *standard* C.
Portability is, of course, a matter of degree.

S.
Jul 17 '06 #7
"Manmeet Mittal" <ma************@yahoo.comwrites:
>> Hi all this is Manmeet Mittal,
I want to create menus and borders in c. How can make it. What r its codings.
The ">" characters you see at the beginnings of lines in Usenet
postings have a specific meaning. They denote text that is quoted
from previous articles. Please don't add them to your own new text.
If you post a followup, your newsreader (or, in your case, the Google
Groups interface) will insert them for you.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jul 17 '06 #8
Walter Roberson wrote:
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>Manmeet Mittal wrote:
>>I want to create menus and borders in c. How can make it. What r its codings.
> puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");

That assumes a fixed width font, which is not a portable assumption.

It also assumes that the display is at least 26 wide by 8 high,
which is also not portable.
With a proportional font it will still work, but just look weird.

What hosted C environment has a display less than 26x8 characters?

My program will also work on teletype printer terminals -- it does not
require a display.

--
Simon.
Jul 17 '06 #9
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>Walter Roberson wrote:
>In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
>> puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");
>That assumes a fixed width font, which is not a portable assumption.
>With a proportional font it will still work, but just look weird.
With a proportional font, it is unlikely to fullfill the requirement
of having a "border". For example in the font 'ariel', the trailing
bar of several lines align with the end fof the U of the word
MENU .

>What hosted C environment has a display less than 26x8 characters?
Windows on PalmOS might well be that small.
>My program will also work on teletype printer terminals -- it does not
require a display.
teletypes sometimes have proportional fonts.
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Jul 18 '06 #10
On Mon, 17 Jul 2006 20:51:40 UTC, Skarmander <in*****@dontmailme.com>
wrote:
Walter Roberson wrote:
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
Manmeet Mittal wrote:
>I want to create menus and borders in c. How can make it. What r its codings.
puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");
That assumes a fixed width font, which is not a portable assumption.
I've never seen a TTY that had not a fixed font.
It also assumes that the display is at least 26 wide by 8 high,
which is also not portable.
No, it works on classic TTY.

Proven on DEC Eclipse about 20 years ago. That was the method the game
startec had woked.
Heck, it assumes *a* display, which is not portable.
No, except you'll say that a TTY is a screen.

There's no way to do
"menus and borders" in the way the OP presumably intends in portable C, so
it hardly matters.
Not true as old classic gaemes written for TTYs and green color
monitors have already proven.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
Jul 18 '06 #11
On Mon, 17 Jul 2006 21:55:18 UTC, Simon Biber <ne**@ralmin.ccwrote:
Walter Roberson wrote:
In article <44**********@news.peopletelecom.com.au>,
Simon Biber <ne**@ralmin.ccwrote:
Manmeet Mittal wrote:
>I want to create menus and borders in c. How can make it. What r its codings.
puts(
"|------------------------|\n"
"| MAIN MENU |\n"
"|------------------------|\n"
"| 1. Add |\n"
"| 2. Subtract |\n"
"| 3. Multiply |\n"
"| 4. Quit |\n"
"|------------------------|\n");
That assumes a fixed width font, which is not a portable assumption.

It also assumes that the display is at least 26 wide by 8 high,
which is also not portable.

With a proportional font it will still work, but just look weird.

What hosted C environment has a display less than 26x8 characters?
What lets you think that each hosted environment has a need for such
displays? I've seen man whereas the display is only one single line
LCD display, having a console with keyboard and TTY like printer.
My program will also work on teletype printer terminals -- it does not
require a display.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
Jul 18 '06 #12

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

Similar topics

3
by: Aditi | last post by:
hi all...i m a software engg. student completed my 2nd yr...i have been asked to make a project during these summer vacations...and hereby i would like to invite some ideas bout the design and...
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
2
by: sachin | last post by:
Hello Everybody I need some help regarding Natural Language Processing. I am designing a MT system from a SOV language to a SOV language. I need a parser which can find the root word...
16
by: C++ Hell | last post by:
Hey everyone just designing a quiz for school and managed to write the code for the questions and answers thou i have to add scores and at the end an overall score does anyone have any idea what to...
3
by: mystilleef | last post by:
Hello, I need to design a plug-in system for a project. The goal is to allow third party developers interact with an application via plug-ins in a clean and robust manner. At this point I am...
8
by: pransri2006 | last post by:
Hi guys! I think all of u know about the designing of compilers. Can any body tell me about the designing of the compilers. And also tell me the difference between the compilers and Interpreter...
38
by: ifti_crazy | last post by:
I am VB6 programmer and wants to start new programming language but i am unable to deciced. i have read about Python, Ruby and Visual C++. but i want to go through with GUI based programming...
2
by: swiftset | last post by:
I'm try to convert a glyph into a format I can easily numerically manipulate. So far I've figured out how to use ttfquery to get a list that represents the outline of a contour in a glyph: from...
30
by: Alf P. Steinbach | last post by:
I once suggested in that SomeOne Else(TM) should propose a string value class that accepted literals and char pointers and so on, with possible custom deleter, and in case of literal strings just...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.