It's possible to execute some action when the help button of caption bar at dialog is clicked?
JĂșlio CĂ©sar M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
It's possible to execute some action when the help button of caption bar at dialog is clicked?

// Help-Button
// ---------------------
REDEFINE BITMAP oBmp2 ID 101 ADJUST RESOURCE "Help1" ;
CURSOR oCursor OF oDlg
oBMP2:bLClicked := { || MyHelp( flag ) }
// ------- Any Actions or Infos -----------------
STATIC FUNCTION MYHELP(flag)
If flag = 1
MsgAlert( "Help-Info 1","Help")
Endif
If flag = 2
HELP_FUNC1()
Endif
RETURN NILUwe,
Thank you very much but, I still can't understanding you ;(
TESTSOURCE DIALOG 92, 20, 463, 308
STYLE DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_DLGFRAME
FONT 11, "Arial"
{
CONTROL "", 110, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 54, 39, 351, 217
CONTROL "", 100, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, -1, 1, 401, 18
CONTROL "", 103, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, 443, 1, 20, 18
DEFPUSHBUTTON "Exit", 60, 360, 280, 60, 22
DEFPUSHBUTTON "&1. Sample", 10, 38, 280, 60, 22
DEFPUSHBUTTON "&2. Sample", 20, 101, 280, 60, 22
DEFPUSHBUTTON "&3. Sample", 30, 164, 280, 60, 22
DEFPUSHBUTTON "&4. Sample", 40, 227, 280, 60, 22
DEFPUSHBUTTON "&5. Sample", 50, 290, 280, 60, 22
EDITTEXT 120, 150, 260, 200, 12
RTEXT "Change Title on Change", -1, 61, 262, 86, 8
CONTROL "", 102, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, 422, 1, 20, 18
CONTROL "", 101, "TBitmap", 0 | WS_CHILD | WS_VISIBLE, 401, 1, 20, 18
}Uwe,
Really, I don't want to create some bitmap's to elaborate a caption bar with buttons on dialog.
I want to use the default buttons of a dialog... the help button with ? symbol!
Is it possible to do?
Hello JC,
As far as i know, it is not possible to use the normal
Dialog-header-buttons ( system ), to use them for your own functions.
The ? - button uses the normal help-system.
That was the reason, i did something by my own.
But why not to create your own dialog-title ?.
It gives you much more control and you can do things like color-changing,
are not possible in a normal dialog-title.
Regards
Uwe ![]()
Uwe,
Yes, you are right! I will try your solution and answer about the results!
Thank you!
Hello JC,
The shown sample is a bit extrem, just to show how it works.
You can choose size and color of the dialog-title in this way,
the user doesn't notice, that there is something extra done.
I will put a sample on this topic, you don't see any difference
between the < normal > dialog-title and your own one.
Regards
Uwe ![]()
METHOD SysCommand( nWParam, nLParam ) CLASS TDialog
if nWParam == SC_CLOSE .and. ::lModal
if GetCapture() != 0
ReleaseCapture()
endif
return .f.
endif
if nWParam == SC_HELP
? "Some block code..." <--- your own source code!
::lHelpIcon = .t.
return .f.
endif
return Super:SysCommand( nWParam, nLParam )Hello JC,
Thank you for the information,
i will have a closer look at the TDialog-class.
Greetings from Germany
uwe ![]()
Hello JC,
I added a function in the TDIALOG-class
for :
METHOD SysCommand( nWParam, nLParam )
it works fine.
As well it is a solution, to control the EXIT-Button.
Regards
Uwe ![]()
Uwe,
That's right! ![]()
Hello JC,
I did some tests and found a problem.
Do you have a solution, how to connect to the Dialog-Id / name ?
I think, inside the class you have just to call a function for the HELP and EXIT.
The function must be defined in your main-prog.
Inside the function you need the name or the Id of the dialog
to start different actions. I think, you don't want the same action
for all dialogs.
As a sample :
If the user clicks on the exit-button, you could save vars
before closing the dialog.
It gets more difficult, if you want to start a action in
relation to a GET ( i don't know, if you want to do this ).
Regards
Uwe ![]()
JĂșlio,
A codeblock to be evaluated would be ok for you for such event ?
Antonio Linares wrote:JĂșlio,
A codeblock to be evaluated would be ok for you for such event ?