PushButton can perform 2 diferent actions?
PushButton can perform 2 diferent actions?
Hello.
it is possible for a Pushbutton to perform two different actions?
One for a short click, and one for a long click.
That is, if we click normal on the button it performs a certain action. But pressing the button for more than 3 seconds performs another action.
This is very common in POS applications.
Is this possible?
Many thanks.
it is possible for a Pushbutton to perform two different actions?
One for a short click, and one for a long click.
That is, if we click normal on the button it performs a certain action. But pressing the button for more than 3 seconds performs another action.
This is very common in POS applications.
Is this possible?
Many thanks.
Pedro Alexandre
Re: PushButton can perform 2 diferent actions?
Button react on BN_CLICKED or BN_DBLCLK so both are "down"
now every XbPart FROM XbpWindow() have o:LbDn and o:LbUp to react.
so you can use a XbpStatic and react like DragDrop when press left Mouse-Button and hold it.
now every XbPart FROM XbpWindow() have o:LbDn and o:LbUp to react.
so you can use a XbpStatic and react like DragDrop when press left Mouse-Button and hold it.
greetings by OHR
Jimmy
Jimmy
Re: PushButton can perform 2 diferent actions?
I think I can add this to DCPUSHBUTTOXP.
The eXpress train is coming - and it has more cars.
Re: PushButton can perform 2 diferent actions?
Hello,
In a TouchScreen scenario, pressing and holding the button makes a lot of sense.
I plan to use it to allow the user to configure their touch keyboard.
So that the user can set the desired actions for that button.
I usually see this functionality in most POS programs that are on the market.
The possibility of a second action on the button increases power in this command.
Maybe a "SetAction"
Many thanks.
I can wait for some news.
In a TouchScreen scenario, pressing and holding the button makes a lot of sense.
I plan to use it to allow the user to configure their touch keyboard.
So that the user can set the desired actions for that button.
I usually see this functionality in most POS programs that are on the market.
The possibility of a second action on the button increases power in this command.
Maybe a "SetAction"
Many thanks.
I can wait for some news.
Pedro Alexandre
Re: PushButton can perform 2 diferent actions?
That's a possibility. Maybe DELAYACTION.Maybe a "SetAction"
Probably would also require a 2nd parameter the set the delay amount.
@ .. DCPUSHBUTION ACTION <bAction> DELAYACTION <bAction2> CLICKDELAY nSeconds
Of course there would be a Get-Set function to set the default value for CLICKDELAY.
The eXpress train is coming - and it has more cars.
Re: PushButton can perform 2 diferent actions?
Here is an update for you.
This is the way you use the new parameters:
Copy _DCXBUTT.PRG to your \exp20\source\dclipx folder.
Copy _DCGETBX.PRG to your \exp20\source\dclipx folder.
Copy DCDIALOG.CH to your \exp20\include folder.
Rebuild DCLIPX.DLL by running BUILD20.BAT or BUILD19_SL1.BAT
This is the way you use the new parameters:
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oToolBar
DC_XbpPushButtonDelay(1.5)
@ 0,0 DCPUSHBUTTONXP CAPTION 'Test 1' SIZE 20, 1.2 ;
ACTION {||MsgBox('Action 1')} ;
DELAYACTION {||MsgBox('Action 2')} CLICKDELAY 2 ;
COLOR GRA_CLR_WHITE, GRA_CLR_DARKCYAN
@ 2,0 DCPUSHBUTTON CAPTION 'Test 2' SIZE 20, 1.2 ;
ACTION {||MsgBox('Action 1')} ;
DELAYACTION {||MsgBox('Action 2')} CLICKDELAY 1.5
@ 4,0 DCTOOLBAR oToolBAR SIZE 30, 1.2
DCADDBUTTONXP CAPTION 'Test 3' SIZE 20, 1.2 ;
ACTION {||MsgBox('Action 1')} ;
DELAYACTION {||MsgBox('Action 2')} CLICKDELAY 1 ;
COLOR GRA_CLR_WHITE, GRA_CLR_DARKPINK ;
PARENT oToolBar
DCADDBUTTON CAPTION 'Test 4' SIZE 15, 1.2 ;
ACTION {||MsgBox('Action 1')} ;
DELAYACTION {||MsgBox('Action 2')} ;
PARENT oToolBar
DCREAD GUI FIT
RETURN nil
PROC appsys ; RETURN
Copy _DCGETBX.PRG to your \exp20\source\dclipx folder.
Copy DCDIALOG.CH to your \exp20\include folder.
Rebuild DCLIPX.DLL by running BUILD20.BAT or BUILD19_SL1.BAT
- Attachments
-
- buttondelay.zip
- (162.36 KiB) Downloaded 966 times
The eXpress train is coming - and it has more cars.
Re: PushButton can perform 2 diferent actions?
Hello!
Build new dclipx.dll only with this 3 files and start my programm - there is a error
Rebuid DLL with the old files - all is perfect - no error
any idea?
Build new dclipx.dll only with this 3 files and start my programm - there is a error
Rebuid DLL with the old files - all is perfect - no error
any idea?
- Attachments
-
- error.jpg (46.37 KiB) Viewed 18551 times
best regards
Hans
Hans
Re: PushButton can perform 2 diferent actions?
Did you use the new DCDIALOG.CH file?
The eXpress train is coming - and it has more cars.
Re: PushButton can perform 2 diferent actions?
I'm getting an error too.
I rebuilt dclipx.dll with the new files and ran the included test which worked fine. When I rebuild an existing program with no other changes I get this error when I try to run it.
I rebuilt dclipx.dll with the new files and ran the included test which worked fine. When I rebuild an existing program with no other changes I get this error when I try to run it.
Re: PushButton can perform 2 diferent actions?
I think I see the problem but I can't figure out why I'm not getting that error.
I didn't initialize a new variable to a numeric.
Here is an updated _DCXBROW.PRG
I didn't initialize a new variable to a numeric.
Here is an updated _DCXBROW.PRG
- Attachments
-
- _dcxbrow.zip
- (52.87 KiB) Downloaded 1002 times
The eXpress train is coming - and it has more cars.