bAction on Help Button at Dialog Title Bar!?

bAction on Help Button at Dialog Title Bar!?

Postby JC » Tue Oct 21, 2008 1: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Dialog-Title

Postby ukoenig » Tue Oct 21, 2008 2:36 pm

Hello JC,

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

Image

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

Code: Select all  Expand view

// 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 :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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Tue Oct 21, 2008 5: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Dialog-Title

Postby ukoenig » Tue Oct 21, 2008 5: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 :

Code: Select all  Expand view

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 :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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Tue Oct 21, 2008 7: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Dialog-Titles

Postby ukoenig » Tue Oct 21, 2008 7: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » 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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Dialog-Title

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Wed Oct 22, 2008 12:11 pm

Uwe,

Look this! Method of dialog class!

Code: Select all  Expand view
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! :D
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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Sys-command

Postby ukoenig » Wed Oct 22, 2008 1: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Dialog-system-buttons

Postby ukoenig » Wed Oct 22, 2008 4: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby JC » Wed Oct 22, 2008 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Message from System-Dialog-Buttons

Postby ukoenig » Wed Oct 22, 2008 7: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby Antonio Linares » Wed Oct 22, 2008 7:42 pm

Júlio,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41482
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby JC » Wed Oct 22, 2008 7: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests