FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper ButtonBars for Dialog
Posts: 334
Joined: Fri Oct 14, 2005 01:54 PM
ButtonBars for Dialog
Posted: Fri Jan 13, 2006 11:30 PM

I can not find BottonBar functions well with Dialogs Only with Windows . Is this Right ? if So, It is written in NG :
Bar Commands
[ OF | WINDOW | DIALOG <oWnd> ] ;

function main()
local oBar
DEFINE DIALOG oDlg From 1,5 to 20,65 TITLE "FiveWin TWBrowse Power!!!"
DEFINE BUTTONBAR oBar size 20,20 of DIALOG oDlg
ACTIVATE DIALOG oDlg CENTERED
return nil

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ButtonBars for Dialog
Posted: Sat Jan 14, 2006 12:54 AM
You can place a buttonbar at a dialog from the ON INIT clause of the dialog:

   ACTIVATE DIALOG oDlg ;
      ON INIT PlaceButtonBar( oDlg )

...

function PlaceButtonBar( oDlg )

   local oBar

   DEFINE BUTTONBAR oBar size 20,20 of DIALOG oDlg 

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
ButtonBars for Dialog
Posted: Fri Aug 31, 2007 02:56 PM

Hello Antonio,
is to declare OK as Static the best solution or is there an other way to end a DIALOG from a Bar?

BTW: in your example I think DIALOG too much
DEFINE BUTTONBAR oBar size 20,20 of DIALOG oDlg

DEFINE DIALOG oDlg From 1,5 to 20,65 TITLE "FiveWin TWBrowse Power!!!"
DEFINE BUTTONBAR oBar size 20,20 of DIALOG oDlg
ACTIVATE DIALOG oDlg ;
ON INIT PlaceButtonBar( oDlg )

if OK=.t.
...
endif

return nil
function PlaceButtonBar( oDlg )
local oBar

DEFINE BUTTONBAR oBar size 20,20 of oDlg

DEFINE BUTTON FILE ".\bitmaps2\E4.bmp"  OF oBar ;
    ACTION  (OK:=.T.,oDlg:END())  ;
    MESSAGE "Neuen Artikel eingeben"

return nil

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ButtonBars for Dialog
Posted: Fri Aug 31, 2007 04:16 PM

You can delare Ok as local as pass it by reference:

ON INIT PlaceButtonBar( oDlg, @Ok )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
ButtonBars for Dialog
Posted: Fri Aug 31, 2007 04:52 PM

I tried by reference but with no success.

Regards
Otto

INCLUDE "BOX.CH"

INCLUDE "FILEIO.CH"

INCLUDE "FIVEWIN.CH"

INCLUDE "FOLDER.CH"

INCLUDE "INKEY.CH"

INCLUDE "REPORT.CH"

function Main()
LOCAL oWnd

DEFINE WINDOW oWnd from 1,1 TO 30,60 TITLE "TEST";
    MENU bldMenu()
ACTIVATE WINDOW oWnd

return nil

function bldMenu()
LOCAL oMenu
MENU oMenu
MENUITEM "Start" ;
ACTION f_code()
ENDMENU

return oMenu

func f_code
LOCAL oDlg
LOCAL ok := .f.

DEFINE DIALOG oDlg From 1,5 to 20,65 TITLE "Test Dialog with Buttonbar"

 ACTIVATE DIALOG oDlg ;
    ON INIT PlaceButtonBar( oDlg  ,@OK )

if OK=.t.
    msgInfo("OK")
else
    msgInfo("not OK")

endif

return nil

function PlaceButtonBar( oDlg , OK)
local oBar

DEFINE BUTTONBAR oBar size 20,20 of oDlg

DEFINE BUTTON FILE "E4.bmp" OF oBar ;
    ACTION (OK:=.T.,oDlg:END()) ;
    MESSAGE "Neuen Artikel eingeben"

return nil

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ButtonBars for Dialog
Posted: Fri Aug 31, 2007 05:19 PM

Otto,

It should work, if not, then declare it as static

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion