Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
i can't seem to link my menu's in grafix mode Posted by cybersurfer on 23 Nov 2002 at 4:19 PM
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:


 [/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. /]

Report
Re: i can't seem to link my menu's in grafix mode Posted by zibadian on 23 Nov 2002 at 5:09 PM
: 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:
:
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:
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;


Report
Re: i can't seem to link my menu's in grafix mode Posted by cybersurfer on 23 Nov 2002 at 7:44 PM
: : 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:
: :
: 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:
:
: 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;
: 

:
:

Report
Re: can't seem to link my menus in grafix mode(final project) Posted by cybersurfer on 23 Nov 2002 at 7:57 PM
what is the correct syntax to use to build the case statement to link or builod my mens.
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


Report
Re: can't seem to link my menus in grafix mode(final project) Posted by zibadian on 24 Nov 2002 at 1:15 AM
: what is the correct syntax to use to build the case statement to link or builod my mens.
: 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:
  case _AllButtonStatus of
    1: AccessoryMenu;
    2: CustomerMenu;
    3: SystemTools;
    4: { You don't need to handle exit, because it is handled by until }
  end;

Report
Re: can't seem to link my menus in grafix mode(final project) Posted by cybersurfer on 24 Nov 2002 at 5:48 PM
: : what is the correct syntax to use to build the case statement to link or builod my mens.
: : 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:
:
:   case _AllButtonStatus of
:     1: AccessoryMenu;
:     2: CustomerMenu;
:     3: SystemTools;
:     4: { You don't need to handle exit, because it is handled by until }
:   end;
: 

:


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:

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.








Report
Re: can't seem to link my menus in grafix mode(final project) Posted by zibadian on 24 Nov 2002 at 7:26 PM
: : : what is the correct syntax to use to build the case statement to link or builod my mens.
: : : 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:
: :
: :   case _AllButtonStatus of
: :     1: AccessoryMenu;
: :     2: CustomerMenu;
: :     3: SystemTools;
: :     4: { You don't need to handle exit, because it is handled by until }
: :   end;
: : 

: :
:
:
: 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:
:
:
: 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.
: 

:
:
:
:
:
:
:
:

Report
Re: can't seem to link my menus in grafix mode(final project) Posted by cybersurfer on 26 Nov 2002 at 9:31 PM
: : : : what is the correct syntax to use to build the case statement to link or builod my mens.
: : : : 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:
: : :
: : :   case _AllButtonStatus of
: : :     1: AccessoryMenu;
: : :     2: CustomerMenu;
: : :     3: SystemTools;
: : :     4: { You don't need to handle exit, because it is handled by until }
: : :   end;
: : : 

: : :
: :
: :
: : 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:
: :
: :
: : 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.
: : 

: :
: :
: : thanx a whole lot zibadian. i can get back on my surf-board from here. i may have a few more queries tho.
: :
: :
: :
: :
: :
:
:

Report
maus, grafix Posted by viv. on 30 Nov 2002 at 6:14 PM
can some one please tell me where to download the _Maus and _Grafix units?


Report
Re: maus, grafix Posted by zibadian on 1 Dec 2002 at 3:54 AM
: can some one please tell me where to download the _Maus and _Grafix units?
:
See the Pascal Links of this site.

Report
Re: maus, grafix Posted by viv. on 1 Dec 2002 at 11:31 AM
: : can some one please tell me where to download the _Maus and _Grafix units?
: :
: 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





Report
Re: maus, grafix Posted by viv. on 1 Dec 2002 at 11:34 AM
the graphix dl from this site sticks.
where to get _Maus and graphis?



Report
Re: maus, grafix Posted by Manning on 1 Dec 2002 at 11:39 AM
: the graphix dl from this site sticks.
: 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%3A%2F%2Fbuema%2Ech%2Ffurda%2Fgfxlibtp%2Ezip
Report
Re: maus, grafix Posted by zibadian on 1 Dec 2002 at 11:41 AM
: : the graphix dl from this site sticks.
: : 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%3A%2F%2Fbuema%2Ech%2Ffurda%2Fgfxlibtp%2Ezip
:
I also worked for me just fine.
Report
Re: maus, grafix Posted by viv. on 1 Dec 2002 at 5:30 PM
This message was edited by viv. at 2002-12-1 17:39:56

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



Report
Re: maus, grafix Posted by cybersurfer on 1 Dec 2002 at 10:02 PM
: This message was edited by viv. at 2002-12-1 17:39:56

: 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
:
:

: cybersurfer
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 .
:

Report
Re: maus, grafix Posted by viv. on 2 Dec 2002 at 1:43 PM
please i dont have a manual;
send it plz.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.