NO SALE EL MENU EN EL EJEMPLO. COMO PUEDE SALIR
Publicado: Lun Ago 29, 2005 9:20 am
En el ejemplo que tienes en datacontrol sale las siguiente imagen que
adjunta
que tiene que salir el menu y no sale, como puede salir el menu
CLASS TForm1 FROM TForm
COMPONENT oStatusBar1
COMPONENT oDataSource
COMPONENT oDataSet
COMPONENT oBrw
COMPONENT oReBar1
PROPERTY nTag INIT 1 WRITE INLINE ::SetTag( Value )
DATA oToolBar, oRebarBand, oTagMenu, oTagBtn, oFilterBtn, oEdiBusqueda
DATA aTags
METHOD CreateForm()
METHOD FormInitialize( oSender )
METHOD SetTag( Value )
METHOD Filter()
METHOD AddNew()
METHOD Edit()
METHOD Delete()
METHOD DataSetOpen( oSender )
METHOD Report()
METHOD BrwSeek( oSender, cSeek )
METHOD BrwChange( oSender, lBookMarkChanged )
ENDCLASS
#include "Form1.xfm"
//---------------------------------------------------------- ----------------
----
METHOD FormInitialize( oSender ) CLASS TForm1
LOCAL oSortMenu
LOCAL aTags
LOCAL nFor
set date italian
MENU ::oMenu
MENUITEM "&File"
MENU
MENUITEM "&Append"
MENUITEM "&Edit"
MENUITEM "&Delete"
SEPARATOR
MENUITEM "&Printer configuration" ACTION Printer:Setup( Self )
SEPARATOR
MENUITEM "&Exit" ACTION ::Close()
ENDMENU
MENUITEM "&Help"
MENU
MENUITEM "About..." ;
ACTION ShellAbout( Application:Handle, Application:cTitle,
;
"Copyright Xailer 2003-2004" )
ENDMENU
ENDMENU
oSortMenu := TMenu():Create( Self, .t. )
::aTags := ::oDataSet:GetTags()
::oDataSet:OrdSetFocus("")
FOR nFor := 1 to len( ::aTags )
WITH OBJECT TMenuItem():New( oSortMenu )
:cText := "Order by " + ::aTags[ nFor ]
:Cargo := nFor
:OnClick := {|o| ::nTag := o:Cargo }
:Create()
END
NEXT
WITH OBJECT ::oToolBar := TToolBar():New( ::oRebar1 )
:lList := .t.
:lAutoSize := .t.
:Create()
::oTagBtn := :AddButton( "", "BMP_SORT",,, "Set Order", {||
::nTag++ }, oSortMenu )
::nTag := 1
WITH OBJECT ::oFilterBtn := :AddButton( "", "BMP_FILTER",,, "Set
Filter", {|| ::Filter() } )
:lChecked := .f.
END
:AddSeparator()
:AddButton( "", "BMP_FIRST",,, "First record", {|| ::oBrw:GoTop() } )
:AddButton( "", "BMP_PREVIOUS",,, "Previous record", {||
::oBrw:GoUp() } )
:AddButton( "", "BMP_NEXT",,, "Next record ", {|| ::oBrw:GoDown() } )
:AddButton( "", "BMP_LAST",,, "Last record", {|| ::oBrw:GoBottom() } )
:AddSeparator()
:AddButton( "", "BMP_APPEND",,, "Append", {|| ::AddNew() } )
:AddButton( "", "BMP_EDIT",,, "Edit", {|| ::Edit() } )
:AddButton( "", "BMP_DELETE",,, "Delete", {|| ::Delete() } )
:AddSeparator()
:AddButton( "", "XA_BMP_PRINTER",,, "Print", {|| ::Report() } )
:AddButton( "", "XA_BMP_EXIT",,, "Exit", {|| ::Close() } )
END
WITH OBJECT ::oRebarBand := TRebarBand():New( ::oRebar1 )
:oControl := ::oToolBar
:Create()
END
WITH OBJECT ::oEdiBusqueda := TEditBtn():New( ::oRebar1 )
:oBitmap := "lupa16"
:OnBtnClick := {|o| ::oBrw:Seek( o:Value ), nil }
:nMaxLength := 100
:Create()
END
WITH OBJECT TRebarBand():New( ::oRebar1 )
:cText := "Búsqueda:"
:oControl := ::oEdiBusqueda
:Create()
END
RETURN Nil
Esto es la programación, si quiero que salga el menu, tengo que estirar un
poco la ventana
Attached files
adjunta
que tiene que salir el menu y no sale, como puede salir el menu
CLASS TForm1 FROM TForm
COMPONENT oStatusBar1
COMPONENT oDataSource
COMPONENT oDataSet
COMPONENT oBrw
COMPONENT oReBar1
PROPERTY nTag INIT 1 WRITE INLINE ::SetTag( Value )
DATA oToolBar, oRebarBand, oTagMenu, oTagBtn, oFilterBtn, oEdiBusqueda
DATA aTags
METHOD CreateForm()
METHOD FormInitialize( oSender )
METHOD SetTag( Value )
METHOD Filter()
METHOD AddNew()
METHOD Edit()
METHOD Delete()
METHOD DataSetOpen( oSender )
METHOD Report()
METHOD BrwSeek( oSender, cSeek )
METHOD BrwChange( oSender, lBookMarkChanged )
ENDCLASS
#include "Form1.xfm"
//---------------------------------------------------------- ----------------
----
METHOD FormInitialize( oSender ) CLASS TForm1
LOCAL oSortMenu
LOCAL aTags
LOCAL nFor
set date italian
MENU ::oMenu
MENUITEM "&File"
MENU
MENUITEM "&Append"
MENUITEM "&Edit"
MENUITEM "&Delete"
SEPARATOR
MENUITEM "&Printer configuration" ACTION Printer:Setup( Self )
SEPARATOR
MENUITEM "&Exit" ACTION ::Close()
ENDMENU
MENUITEM "&Help"
MENU
MENUITEM "About..." ;
ACTION ShellAbout( Application:Handle, Application:cTitle,
;
"Copyright Xailer 2003-2004" )
ENDMENU
ENDMENU
oSortMenu := TMenu():Create( Self, .t. )
::aTags := ::oDataSet:GetTags()
::oDataSet:OrdSetFocus("")
FOR nFor := 1 to len( ::aTags )
WITH OBJECT TMenuItem():New( oSortMenu )
:cText := "Order by " + ::aTags[ nFor ]
:Cargo := nFor
:OnClick := {|o| ::nTag := o:Cargo }
:Create()
END
NEXT
WITH OBJECT ::oToolBar := TToolBar():New( ::oRebar1 )
:lList := .t.
:lAutoSize := .t.
:Create()
::oTagBtn := :AddButton( "", "BMP_SORT",,, "Set Order", {||
::nTag++ }, oSortMenu )
::nTag := 1
WITH OBJECT ::oFilterBtn := :AddButton( "", "BMP_FILTER",,, "Set
Filter", {|| ::Filter() } )
:lChecked := .f.
END
:AddSeparator()
:AddButton( "", "BMP_FIRST",,, "First record", {|| ::oBrw:GoTop() } )
:AddButton( "", "BMP_PREVIOUS",,, "Previous record", {||
::oBrw:GoUp() } )
:AddButton( "", "BMP_NEXT",,, "Next record ", {|| ::oBrw:GoDown() } )
:AddButton( "", "BMP_LAST",,, "Last record", {|| ::oBrw:GoBottom() } )
:AddSeparator()
:AddButton( "", "BMP_APPEND",,, "Append", {|| ::AddNew() } )
:AddButton( "", "BMP_EDIT",,, "Edit", {|| ::Edit() } )
:AddButton( "", "BMP_DELETE",,, "Delete", {|| ::Delete() } )
:AddSeparator()
:AddButton( "", "XA_BMP_PRINTER",,, "Print", {|| ::Report() } )
:AddButton( "", "XA_BMP_EXIT",,, "Exit", {|| ::Close() } )
END
WITH OBJECT ::oRebarBand := TRebarBand():New( ::oRebar1 )
:oControl := ::oToolBar
:Create()
END
WITH OBJECT ::oEdiBusqueda := TEditBtn():New( ::oRebar1 )
:oBitmap := "lupa16"
:OnBtnClick := {|o| ::oBrw:Seek( o:Value ), nil }
:nMaxLength := 100
:Create()
END
WITH OBJECT TRebarBand():New( ::oRebar1 )
:cText := "Búsqueda:"
:oControl := ::oEdiBusqueda
:Create()
END
RETURN Nil
Esto es la programación, si quiero que salga el menu, tengo que estirar un
poco la ventana
Attached files