Taking advantage of the topic, Master Ant么nio is it possible to do this?
Aprovechando el tema, Maestro Ant么nio, 驴es posible hacer esto?
GET and COMBO in the MESSAGE Bar?
GET y COMBO en la barra de MENSAJES
// GET e COMBO na MESSAGE Bar
#include "FiveWin.ch"
#define MSG_DATA 1
#define MSG_EMP 2
#define MSG_RDD 3
STATIC oWnd
FUNCTION Main()
聽 聽LOCAL oBarData, oBarData1, oBarData2, oMainFont, OGET
聽 聽LOCAL oMainBar
聽 聽LOCAL oCbx1
聽 聽LOCAL oGetData
聽 聽LOCAL dData := Date()
聽 聽LOCAL cCombo := Space( 1 )
聽 聽LOCAL aItens := { 'EMPRESA 1', 'EMPRESA 2', 'EMPRESA 3', 'EMPRESA 4', 'EMPRESA 5' }
聽 聽SET CENTURY ON
聽 聽SET DATE ITALIAN
聽 聽DEFINE FONT oMainFont NAME "Arial" SIZE 0, 14 WEIGHT 0
聽 聽DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE "Inserindo GET e COMBOBOX na Message Bar" MENU BuildMenu()
聽 聽// Define a bar de status da janela principal
聽 聽DEFINE MESSAGE BAR oMainBar OF oWnd CENTER // NOINSET
聽 聽oMainBar:nHeight := 31 // nao consegui alterar a altura do COMBO por isto almentei a altura da MESSAGE
聽 聽// define os itens da message bar
聽 聽DEFINE MSGITEM oBarData OF oMainBar PROMPT '' SIZE 100 ACTION SetData( oGet )
聽 聽DEFINE MSGITEM oBarData1 OF oMainBar PROMPT '' SIZE 100 ACTION SetEmp( oCbx1 )
聽 聽DEFINE MSGITEM oBarData2 OF oMainBar PROMPT '' SIZE 100
聽 聽oWnd:oMsgBar:aItem[ MSG_DATA ]:SetText( Date() )
聽 聽oWnd:oMsgBar:aItem[ MSG_EMP ]:SetText( 'EMPRESA 1' )
聽 聽// calcula coordenadas dos itens da MSGBAR
聽 聽// nLinBar := oWnd:oMsgBar:nTop // topo da MSGBAR
聽 聽// nColData := oWnd:oMsgBar:aItem[MSG_DATA]:nLeft // coluna da data da MSGBAR
聽 聽// nColEmp := oWnd:oMsgBar:aItem[MSG_EMP]:nLeft // coluna da empresa da MSGBAR
聽 聽// cria o GET
聽 聽@ 0, 0 GET oGet VAR dData OF oWnd SIZE 92, 21 PIXEL FONT oMainFont CENTER
聽 聽oGet:Hide() // esconde o GET
聽 聽oGet:bChange := {|| VlData( oGet ) } // le teclas pressionadas
聽 聽oGet:bKeyDown := {|| VlData( oGet ) } // le tecla ESC
聽 聽// cria o COMBO
聽 聽// @ nLinBar+5, nColEmp COMBOBOX oCbx1 VAR cCombo ;
聽 聽@ 0, 0 COMBOBOX oCbx1 VAR cCombo ;
聽 聽 聽 ITEMS aItens ;
聽 聽 聽 OF oWnd ;
聽 聽 聽 SIZE 93, 100 ;
聽 聽 聽 PIXEL ;
聽 聽 聽 ON CHANGE VlEmp( oCbx1 ) ;
聽 聽 聽 STYLE CBS_DROPDOWNLIST ;
聽 聽 聽 FONT oMainFont
聽 聽//oCbx1:Hide() // esconde o COMBO
聽 聽ACTIVATE WINDOW oWnd
RETURN NIL
FUNCTION BuildMenu()
聽 聽LOCAL oMenu
聽 聽MENU oMenu
聽 聽 聽 MENUITEM "&Information"
聽 聽MENU
聽 聽MENUITEM "&About..." ACTION MsgAbout( "FiveWin", "FiveTech" )
聽 聽SEPARATOR
聽 聽MENUITEM "&End..." ACTION oWnd:End()
聽 聽ENDMENU
聽 聽MENUITEM "&Child Windows"
聽 聽MENU
聽 聽 聽 MENUITEM "&Tiled" ACTION oWnd:Tile()
聽 聽 聽 MENUITEM "&Cascade" ACTION oWnd:Cascade()
聽 聽ENDMENU
聽 聽ENDMENU
RETURN oMenu
STATIC FUNCTION SetData( oGet )
聽 聽oGet:nTop 聽:= oWnd:oMsgBar:nTop + 5 // topo da MSGBAR
聽 聽oGet:nLeft := oWnd:oMsgBar:aItem[ MSG_DATA ]:nLeft // coluna da data da MSGBAR
聽 聽oGet:Show()
聽 聽oGet:Enable()
聽 聽oGet:SetFocus()
聽 聽oGet:SelectAll()
聽 聽// desabilita a MSGBAR
聽 聽oWnd:oMsgBar:Disable()
RETURN NIL
STATIC FUNCTION VlData( oGet )
聽 聽// testa a tecla ENTER e a validacao do GET
聽 聽IF oGet:nLastKey == VK_RETURN .AND. oGet:lValid
聽 聽 聽 oWnd:oMsgBar:aItem[ MSG_DATA ]:SetText( oGet:VarGet() ) // -> esta linha nao vai existir
聽 聽 聽 // SCData(oGet:VarGet())
聽 聽 聽 oGet:Hide()
聽 聽 聽 oGet:Disable()
聽 聽 聽 // abilita a MSGBAR
聽 聽 聽 oWnd:oMsgBar:Enable()
聽 聽ENDIF
聽 聽// testa tecla ESC
聽 聽IF oGet:nLastKey == VK_ESCAPE
聽 聽 聽 oGet:Hide()
聽 聽 聽 oGet:Disable()
聽 聽 聽 // abilita a MSGBAR
聽 聽 聽 oWnd:oMsgBar:Enable()
聽 聽ENDIF
RETURN NIL
STATIC FUNCTION SetEmp( oCbx )
聽 聽oCbx:nTop := oWnd:oMsgBar:nTop + 5 // topo da MSGBAR
聽 聽oCbx:nLeft := oWnd:oMsgBar:aItem[ MSG_EMP ]:nLeft // coluna da empresa da MSGBAR
聽 聽oCbx:Show()
聽 聽// posiciona o COMBOBOX
聽 聽oCbx:Set( oWnd:oMsgBar:aItem[ MSG_EMP ]:cMsg )
聽 聽oCbx:Enable()
聽 聽oCbx:SetFocus()
聽 聽// desabilita a MSGBAR
聽 聽oWnd:oMsgBar:Disable()
RETURN NIL
STATIC FUNCTION VlEmp( oCbx )
聽 聽oCbx:Hide()
聽 聽oCbx:Disable()
聽 聽// abilita a MSGBAR
聽 聽oWnd:oMsgBar:Enable()
聽 聽// atualiza a MSGBAR
聽 聽oWnd:oMsgBar:aItem[ MSG_EMP ]:SetText( oCbx:VarGet() )
RETURN NIL
// FIN / END
Muchas gracias. Many thanks.
Regards, saludos.