FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bAction on Help Button at Dialog Title Bar!?
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Tue Oct 21, 2008 01:46 PM

It's possible to execute some action when the help button of caption bar at dialog is clicked?

Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Dialog-Title
Posted: Tue Oct 21, 2008 02:36 PM
Hello JC,

I think, the absolute control what happens inside the Dialog-Title,
you can get only with creating your own one.



Inside the Dialog, you can define flags for the help :

// 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 NIL


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Tue Oct 21, 2008 05:00 PM

Uwe,

Thank you very much but, I still can't understanding you ;(

Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Dialog-Title
Posted: Tue Oct 21, 2008 05:32 PM
Hello JC,

What you have to do if you work with resources :

At first, delete the title-text of the dialog ( you need a dialog-frame with no Title )
2. Place a bitmap on top of the dialog ( on the place where the title has been ).
3. At the end ( righthandside ) put some more bitmaps for the buttons.

sample : 1. Bitmap = Title, 2. Bitmap = help, 3. Bitmap = Minimize, 4. Bitmap = Exit.

A Resource-sample :

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
}


The same you can do without resources.

The complete source you can find in another topic :

http://fivetechsoft.com/forums/viewtopic.php?t=13035

Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Tue Oct 21, 2008 07:11 PM

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?

Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Dialog-Titles
Posted: Tue Oct 21, 2008 07:22 PM

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

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Wed Oct 22, 2008 11:03 AM

Uwe,

Yes, you are right! I will try your solution and answer about the results!
Thank you!

Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Dialog-Title
Posted: Wed Oct 22, 2008 11:13 AM

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

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Wed Oct 22, 2008 12:11 PM
Uwe,

Look this! Method of dialog class!

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 )


Here is possible to execute! :-)
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Sys-command
Posted: Wed Oct 22, 2008 01:42 PM

Hello JC,

Thank you for the information,

i will have a closer look at the TDialog-class.

Greetings from Germany
uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Dialog-system-buttons
Posted: Wed Oct 22, 2008 04:21 PM

Hello JC,

I added a function in the TDIALOG-class
for :

METHOD SysCommand( nWParam, nLParam )

define SC_HELP 61824

define SC_CLOSE 61536 // 0xF060

it works fine.

As well it is a solution, to control the EXIT-Button.

Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Wed Oct 22, 2008 06:49 PM

Uwe,

That's right! ;)

Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Message from System-Dialog-Buttons
Posted: Wed Oct 22, 2008 07:15 PM

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

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
bAction on Help Button at Dialog Title Bar!?
Posted: Wed Oct 22, 2008 07:42 PM

JĂșlio,

A codeblock to be evaluated would be ok for you for such event ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
bAction on Help Button at Dialog Title Bar!?
Posted: Wed Oct 22, 2008 07:55 PM
Antonio Linares wrote:JĂșlio,

A codeblock to be evaluated would be ok for you for such event ?


Antonio,

A codeblock is the best way for this... Yes, would be ok for me!
But it should be generic... something that can be configure for each dialog...
It's possible!?
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9