473,796 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1419
In article <11************ *********@h48g2 000cwc.googlegr oups.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******** *************@h 48g2000cwc.goog legroups.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("Subtracti ng"); break;
case 3: puts("Multiplyi ng"); break;
case 4: break;
default: puts("Invalid choice");
}
}
return 0;
}

--
Simon.
Jul 17 '06 #4
In article <44**********@n ews.peopletelec om.com.au>,
Simon Biber <ne**@ralmin.cc wrote:
>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**********@n ews.peopletelec om.com.au>,
Simon Biber <ne**@ralmin.cc wrote:
>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.comwrite s:
>> 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_Keit h) 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**********@n ews.peopletelec om.com.au>,
Simon Biber <ne**@ralmin.cc wrote:
>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**********@n ews.peopletelec om.com.au>,
Simon Biber <ne**@ralmin.cc wrote:
>Walter Roberson wrote:
>In article <44**********@n ews.peopletelec om.com.au>,
Simon Biber <ne**@ralmin.cc wrote:
>> 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

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

Similar topics

3
1320
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 implementation of an APPLICATION MONITORING SYSTEM....i have to start from scrach so please tell me how to go bout it rite from the beggining this is the first time i m making a project of this complexity... i have to make a system used by the IT...
2
3901
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 http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it is not possible, therefore assuming it is a client script problem? the script works last time...
2
1543
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 corresponding to each word and can generate some info. Gender, Number, Person with the help of implementing Grammatical rules. Since It is between SOV lnguages so I have no need a LWG. I am new t this field so not getting any idea how to kick off the
16
4202
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 do or what i am talkin about
3
1898
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 overwhelmed by my inexperience with designing plug-in systems. Are there any good tutorials on how to design good plug-in systems with Python, or any language? What are the best
8
2194
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 which weresically used by the computers. I want to know about the basic compiler software.
38
2681
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 language like VB.net so will you please guide me which GUI based language has worth with complete OOPS Characteristics will wait for the answer
2
2710
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 ttfquery import describe, glyphquery, glyph f = describe.openFont("/usr/share/fonts/truetype/freefont/ FreeSans.ttf") n = glyphquery.glyphName(f, 'D') g = glyph.Glyph(n) c = g.calculateContours(f)
30
2476
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 carrying the original pointer. In other words, for the simplest usage code: * no overhead (just carrying a pointer or two), and * no possibility of exceptions (for that case).
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7552
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.