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
ButtonBars for Dialog
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
You can place a buttonbar at a dialog from the ON INIT clause of the dialog:
Code: Select all
ACTIVATE DIALOG oDlg ;
ON INIT PlaceButtonBar( oDlg )
...
function PlaceButtonBar( oDlg )
local oBar
DEFINE BUTTONBAR oBar size 20,20 of DIALOG oDlg
return nil
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: