Is it possible to have more than 1 "onclick" entry in a button? I want the button click to do 2 things.
Alan
ONCLICK question
Moderator: Rathinagiri
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: ONCLICK question
Depends on what you want
When ON CLICK you can call a command, function, or procedure
What do you wnt?
When ON CLICK you can call a command, function, or procedure
What do you wnt?
Re: ONCLICK question
Simple example may help you, you may define multiple action in this way
Code: Select all
/*
* HMG - Harbour Win32 GUI library
* Copyright 2002-2008 Roberto Lopez <mail.box.hmg@gmail.com>
* http://www.hmgforum.com//
*/
#include "hmg.ch"
Function Main()
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 400 ;
MAIN;
TITLE 'Button Test'
@ 10,10 LABEL Label_1 AUTOSIZE VALUE 'Value before button press'
@ 70,170 BUTTON Button_1 CAPTION 'Test_Buton' ;
ACTION (Form_1.label_1.value := "Button 1st event", ;
MsGINFO("Button 2nd event"))
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return nil
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: ONCLICK question
Thanks for that. But I use "define button" and in the docs ACTION is not shown as an option. Anyway, I decided to try the same idea with "ON CLICK" and it seems to work: ONCLICK { DeleteCheck := .T. , SeekText() }.
Regards,
Alan
Regards,
Alan
Re: ONCLICK question
DEFINE BUTTON <ButtonName>
PARENT <ParentWindowName>
ROW <nValue>
COL <nValue>
CAPTION <cValue>
PICTURE <cValue>
PICTALIGNMENT Top | Left | Right | Bottom
ONCLICK <ActionProcedure>
WIDTH <nValue>
HEIGHT <nValue>
FONTNAME <cValue>
FONTSIZE <nValue>
FONTBOLD <lValue>
FONTITALIC <lValue>
FONTUNDERLINE <lValue>
FONTSTRIKEOUT <lValue>
TOOLTIP <cValue>
FLAT <lValue>
TRANSPARENT <lValue>
ONGOTFOCUS <ActionProcedure>
ONLOSTFOCUS <ActionProcedure>
TABSTOP <lValue>
HELPID <nValue>
VISIBLE <lValue>
MULTILINE <lValue>
END BUTTON
@ <nRow> ,<nCol>
BUTTON <ControlName>
[ OF | PARENT <ParentWindowName> ]
CAPTION <cCaption>
PICTURE <cPictureName> [ TOP | BOTTOM | LEFT | RIGHT ]
ACTION | ONCLICK | ON CLICK <ActionProcedureName> | <bBlock>
[ WIDTH <nWidth> HEIGHT <nHeight> ]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ NOTRANSPARENT ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ MULTILINE ]
Is the same...
PARENT <ParentWindowName>
ROW <nValue>
COL <nValue>
CAPTION <cValue>
PICTURE <cValue>
PICTALIGNMENT Top | Left | Right | Bottom
ONCLICK <ActionProcedure>
WIDTH <nValue>
HEIGHT <nValue>
FONTNAME <cValue>
FONTSIZE <nValue>
FONTBOLD <lValue>
FONTITALIC <lValue>
FONTUNDERLINE <lValue>
FONTSTRIKEOUT <lValue>
TOOLTIP <cValue>
FLAT <lValue>
TRANSPARENT <lValue>
ONGOTFOCUS <ActionProcedure>
ONLOSTFOCUS <ActionProcedure>
TABSTOP <lValue>
HELPID <nValue>
VISIBLE <lValue>
MULTILINE <lValue>
END BUTTON
@ <nRow> ,<nCol>
BUTTON <ControlName>
[ OF | PARENT <ParentWindowName> ]
CAPTION <cCaption>
PICTURE <cPictureName> [ TOP | BOTTOM | LEFT | RIGHT ]
ACTION | ONCLICK | ON CLICK <ActionProcedureName> | <bBlock>
[ WIDTH <nWidth> HEIGHT <nHeight> ]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ NOTRANSPARENT ]
[ ON GOTFOCUS <OnGotFocusProcedur> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ MULTILINE ]
Is the same...
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.