i am using a mouse in my pascal program along with some graphical menu's which i dloaded from this site. this thing is i want to know how do i get to link these menu's when i click on the option when i am testing it. i tried case statemenst but the synatx is wrong and i get an error or i should not use case statements. i also want to know if a user can write from the keyboard when in grafix mode if not how can i get around it.
so of my code:
[code] [/Program Resultz (input,output);
uses crt, mouse,Graph,_Grafix,_Maus;
VAR
gmx,gmy : integer;
x:string;
Procedure menu(gmx,gmy:integer);
Begin
_InitGrafix(detect,vgahi,1,'');
setbkcolor(blue);
_DrawWindow(40,40,getmaxX - 100 ,getmaxY - 60,'Resultz DB_PRO V.S.1.0');
_SetMouseWindow(5,5,getmaxX - 10,getmaxY - 10);
settextjustify(centertext,centertext);
outtextxy(270,85 ,' MAIN MENU ');
_NewButton('Accessory Inventory','Accessory Database',180,100,350,125);
_NewButton('Customer Database','Customer Database', 180,160,350,185);
_NewButton('Report Generator','Report Generator', 180,220,350,245);
_NewButton('System Tools','System Tools', 180,280,350,305);
_NewButton('exit','Exit System' , 180,360,350,385);
repeat
_AllButtonStatus;
until _ButtonStatus('exit')=true;
{close the grafikmode and hide the mouse}
_closegrafix;
end; {there is a problem in this line}
{Procedure inventory(gmx,gmy:integer);
begin
_InitGrafix(detect,vgahi,1,'');
setbkcolor(blue);
_DrawWindow(40,40,getmaxX - 100 ,getmaxY - 60,'Resultz DB_PRO V.S.1.0');
_SetMouseWindow(5,5,getmaxX - 10,getmaxY - 10);
settextjustify(centertext,centertext);
outtextxy(270,85 ,' ACCESSORY DATABSE ');
_NewButton('ADD','ADD NEW ACCESSORY',80,100,350,125);
_NewButton('EDIT','EDIT DATABASE',180,788,233,443);
_NewButton('DEL' ,'DELETE ACCESSORY', 180,160,350,185);
_NewButton('VIEW','VIEW ACCESSORY ', 180,220,350,245);
_NewButton('nview', 'VIEW ENTIRE DATABSASE',180,566,778,777);
_NewButton('SAVE','SAVE DATABSE', 180,280,350,305);
_NewButton('CLOSE','MAIN MENU' , 180,360,350,365);
if _buttonstatus('close')=true
then
menu(gmx,gmy);
end; }
begin
menu(gmx,gmy);
{inventory(gmx,gmy);}
end. /]
Comments
: so of my code:
:
According to the source in the _Grafix unit, the _AllButtonStatus returns an integer, which is the index of the button in the list. The 'Accessory Inventory' has an index of 1, 'Customer Database' of 2, etc. You can use a case statement to perform the button click.
It looks like it is possible to type text. Here is a small code, which allows the user to enter a text:
[code]
function EnterText: string;
var
ch: char;
Index: integer;
begin
_NewTextBox('SomeBox','',100, 100, 400, 150); { Create a new box }
Index := _GetTextBoxIndex('SomeBox'); { Remember index }
repeat
ch := ReadKey;
case ch of
#8: { Delete/Backspace }
if Length(_TextBox[Index].TextBoxText) > 0 then
_SetTextBoxText('SomeBox', Copy(_TextBox[Index].TextBoxText, 1, Length(_TextBox[Index].TextBoxText)-1);
#13: { Enter } begin end;
else _SetTextBoxText('SomeBox', _TextBox[Index].TextBoxText+ch);
end;
until ch = #13;
end;
[/code]
: : so of my code:
: :
: According to the source in the _Grafix unit, the _AllButtonStatus returns an integer, which is the index of the button in the list. The 'Accessory Inventory' has an index of 1, 'Customer Database' of 2, etc. You can use a case statement to perform the button click.
: It looks like it is possible to type text. Here is a small code, which allows the user to enter a text:
: [code]
: function EnterText: string;
: var
: ch: char;
: Index: integer;
: begin
: _NewTextBox('SomeBox','',100, 100, 400, 150); { Create a new box }
: Index := _GetTextBoxIndex('SomeBox'); { Remember index }
: repeat
: ch := ReadKey;
: case ch of
: #8: { Delete/Backspace }
: if Length(_TextBox[Index].TextBoxText) > 0 then
: _SetTextBoxText('SomeBox', Copy(_TextBox[Index].TextBoxText, 1, Length(_TextBox[Index].TextBoxText)-1);
: #13: { Enter } begin end;
: else _SetTextBoxText('SomeBox', _TextBox[Index].TextBoxText+ch);
: end;
: until ch = #13;
: end;
: [/code]
:
:
mine goes like this :
[/ case _button[index]^buttonname of
1:accessorymenu;
2:customermenu;
3:sytemtools;
4:exit;
end;
i get an error about ordinal expression plz help this is my final project fro my assoc. degree
: mine goes like this :
:
: [/ case _button[index]^buttonname of
: 1:accessorymenu;
: 2:customermenu;
: 3:sytemtools;
: 4:exit;
: end;
:
: i get an error about ordinal expression plz help this is my final project fro my assoc. degree
:
:
:
No. You need to use this code:
[code]
case _AllButtonStatus of
1: AccessoryMenu;
2: CustomerMenu;
3: SystemTools;
4: { You don't need to handle exit, because it is handled by until }
end;
[/code]
: : mine goes like this :
: :
: : [/ case _button[index]^buttonname of
: : 1:accessorymenu;
: : 2:customermenu;
: : 3:sytemtools;
: : 4:exit;
: : end;
: :
: : i get an error about ordinal expression plz help this is my final project fro my assoc. degree
: :
: :
: :
: No. You need to use this code:
: [code]
: case _AllButtonStatus of
: 1: AccessoryMenu;
: 2: CustomerMenu;
: 3: SystemTools;
: 4: { You don't need to handle exit, because it is handled by until }
: end;
: [/code]
:
thanx a lot. one last thing :
my mouse will not animate so when i pass it over the buttons so that i can access the other menus,it works only for the exit button but not the other buttons in the main menu. here is some code i have so far:
[code]
Procedure menu(gmx,gmy:integer);
Begin
_InitGrafix(detect,vgahi,1,'');
setbkcolor(blue);
_DrawWindow(40,40,getmaxX - 100 ,getmaxY - 60,'Resultz DB_PRO V.S.1.0');
_SetMouseWindow(5,5,getmaxX - 10,getmaxY - 10);
settextjustify(centertext,centertext);
outtextxy(270,85 ,' MAIN MENU ');
_NewButton('Accessory Inventory','Accessory Database', 180,100,350,125);
_NewButton('Customer Database','Customer Database', 180,160,350,185);
_NewButton('Report Generator','Report Generator', 180,220,350,245);
_NewButton('System Tools','System Tools', 180,280,350,305);
_NewButton('exit','Exit System' , 180,360,350,385);
_AllButtonStatus;
_ButtonStatus('exit')=true;
begin
menu(gmx,gmy);
CASE _buttonstatus of
1: accessorymenu;
2:customerdatabase;
3:systemtools
end;
end.
[/code]
: : : mine goes like this :
: : :
: : : [/ case _button[index]^buttonname of
: : : 1:accessorymenu;
: : : 2:customermenu;
: : : 3:sytemtools;
: : : 4:exit;
: : : end;
: : :
: : : i get an error about ordinal expression plz help this is my final project fro my assoc. degree
: : :
: : :
:
:
:
:
:
:
: : :
: : No. You need to use this code:
: : [code]
: : case _AllButtonStatus of
: : 1: AccessoryMenu;
: : 2: CustomerMenu;
: : 3: SystemTools;
: : 4: { You don't need to handle exit, because it is handled by until }
: : end;
: : [/code]
: :
:
:
: thanx a lot. one last thing :
: my mouse will not animate so when i pass it over the buttons so that i can access the other menus,it works only for the exit button but not the other buttons in the main menu. here is some code i have so far:
Here is the updated code:
:
: [code]
: Procedure menu(gmx,gmy:integer);
: Begin
:
: _InitGrafix(detect,vgahi,1,'');
:
: setbkcolor(blue);
:
: _DrawWindow(40,40,getmaxX - 100 ,getmaxY - 60,'Resultz DB_PRO V.S.1.0');
:
: _SetMouseWindow(5,5,getmaxX - 10,getmaxY - 10);
: settextjustify(centertext,centertext);
: outtextxy(270,85 ,' MAIN MENU ');
:
: _NewButton('Accessory Inventory','Accessory Database', 180,100,350,125);
: _NewButton('Customer Database','Customer Database', 180,160,350,185);
: _NewButton('Report Generator','Report Generator', 180,220,350,245);
: _NewButton('System Tools','System Tools', 180,280,350,305);
: _NewButton('exit','Exit System' , 180,360,350,385);
:
: begin
: menu(gmx,gmy);
repeat
: CASE _buttonstatus of
: 1: accessorymenu;
: 2:customerdatabase;
: 3:systemtools
: until _ButtonStatus('exit')=true;
: end;
: end.
: [/code]
:
:
:
:
:
:
:
:
: : : : mine goes like this :
: : : :
: : : : [/ case _button[index]^buttonname of
: : : : 1:accessorymenu;
: : : : 2:customermenu;
: : : : 3:sytemtools;
: : : : 4:exit;
: : : : end;
: : : :
: : : : i get an error about ordinal expression plz help this is my final project fro my assoc. degree
: : : :
: : : :
: :
: :
: :
: :
: :
: :
: : : :
: : : No. You need to use this code:
: : : [code]
: : : case _AllButtonStatus of
: : : 1: AccessoryMenu;
: : : 2: CustomerMenu;
: : : 3: SystemTools;
: : : 4: { You don't need to handle exit, because it is handled by until }
: : : end;
: : : [/code]
: : :
: :
: :
: : thanx a lot. one last thing :
: : my mouse will not animate so when i pass it over the buttons so that i can access the other menus,it works only for the exit button but not the other buttons in the main menu. here is some code i have so far:
:
: Here is the updated code:
: :
: : [code]
: : Procedure menu(gmx,gmy:integer);
: : Begin
: :
: : _InitGrafix(detect,vgahi,1,'');
: :
: : setbkcolor(blue);
: :
: : _DrawWindow(40,40,getmaxX - 100 ,getmaxY - 60,'Resultz DB_PRO V.S.1.0');
: :
: : _SetMouseWindow(5,5,getmaxX - 10,getmaxY - 10);
: : settextjustify(centertext,centertext);
: : outtextxy(270,85 ,' MAIN MENU ');
: :
: : _NewButton('Accessory Inventory','Accessory Database', 180,100,350,125);
: : _NewButton('Customer Database','Customer Database', 180,160,350,185);
: : _NewButton('Report Generator','Report Generator', 180,220,350,245);
: : _NewButton('System Tools','System Tools', 180,280,350,305);
: : _NewButton('exit','Exit System' , 180,360,350,385);
: :
: : begin
: : menu(gmx,gmy);
: repeat
: : CASE _buttonstatus of
: : 1: accessorymenu;
: : 2:customerdatabase;
: : 3:systemtools
: : until _ButtonStatus('exit')=true;
: : end;
: : end.
: : [/code]
: :
: :
: : thanx a whole lot zibadian. i can get back on my surf-board from here. i may have a few more queries tho.
: :
: :
: :
: :
: :
:
:
:
See the Pascal Links of this site.
: :
: See the Pascal Links of this site.
:
:
u see i search for _Graphix on this site and the link to dl it is broken.
and i can't find _Maus
where to get _Maus and graphis?
: where to get _Maus and graphis?
The download worked fine for me. Are you trying this link?
http://www.programmersheaven.com/file.asp?FileID=14795&URL=http://buema.ch/furda/gfxlibtp.zip
: : where to get _Maus and graphis?
:
: The download worked fine for me. Are you trying this link?
:
: http://www.programmersheaven.com/file.asp?FileID=14795&URL=http://buema.ch/furda/gfxlibtp.zip
:
I also worked for me just fine.
thanks a bunch. it works now. it was the one i was trying though.
ok, the reason why i wanted those units are for an CXC exam, the equvilant to your lower high exams. i need to 'fancy up' my program.
its well enough but not yet great. its to calc. mensuration problems and make random test for a teacher.
do you know where to get a manual for graphix and/or maux ?
tanks
are u two guys like the webmasters, ? u seem to message a lot.
ok nm i think ill figure out the units words from the samples
: thanks a bunch. it works now. it was the one i was trying though.
: ok, the reason why i wanted those units are for an CXC exam, the equvilant to your lower high exams. i need to 'fancy up' my program.
: its well enough but not yet great. its to calc. mensuration problems and make random test for a teacher.
: do you know where to get a manual for graphix and/or maux ?
: tanks
:
: are u two guys like the webmasters, ? u seem to message a lot.
:
: ok nm i think ill figure out the units words from the samples
:
:
: [b][blue]cybersurfer [/blue][/b]
the unit that u have should come with a manual , if u do not have one reply to this msg and i can send u a copy of mine .
: