Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

i can't seem to link my menu's in grafix mode

cybersurfercybersurfer Posts: 41Member
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. /]

«1

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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:
    [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]

  • cybersurfercybersurfer Posts: 41Member
    : : 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:
    : [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]
    :
    :

  • cybersurfercybersurfer Posts: 41Member
    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


  • zibadianzibadian Posts: 6,349Member
    : 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:
    [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]
  • cybersurfercybersurfer Posts: 41Member
    : : 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:
    : [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]







  • zibadianzibadian Posts: 6,349Member
    : : : 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:
    : : [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]
    :
    :
    :
    :
    :
    :
    :
    :

  • cybersurfercybersurfer Posts: 41Member
    : : : : 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:
    : : : [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.
    : :
    : :
    : :
    : :
    : :
    :
    :

  • viv.viv. Posts: 72Member
    can some one please tell me where to download the _Maus and _Grafix units?


  • zibadianzibadian Posts: 6,349Member
    : can some one please tell me where to download the _Maus and _Grafix units?
    :
    See the Pascal Links of this site.

  • viv.viv. Posts: 72Member
    : : 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





«1
Sign In or Register to comment.