Hi,
How I can change buttonbmp status to TABSTOP or not TABSTOP in execution program?
Thanks in advance.
#include "FiveWin.ch"
#define WS_CHILD 1073741824 // 0x40000000L
#define WS_VISIBLE 268435456 // 0x10000000L
//#define WS_TABSTOP 65536 // 0x00010000L
Function Main()
LOCAL oDlg, oBtn[3]
DEFINE DIALOG oDlg FROM 0,0 TO 300,500 PIXEL TRUEPIXEL
@ 30, 30 BUTTONBMP oBtn[1] PROMPT "&One" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("One")
@ 30, 90 BUTTONBMP oBtn[2] PROMPT "&Two" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("Two - without TabStop")
@ 30,150 BUTTONBMP oBtn[3] PROMPT "&Three" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("Three")
oBtn[2]:nStyle:= nOR(WS_CHILD, WS_VISIBLE)
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
Cgallegoa wrote:
- Code: Select all Expand view
#include "FiveWin.ch"
#define WS_CHILD 1073741824 // 0x40000000L
#define WS_VISIBLE 268435456 // 0x10000000L
//#define WS_TABSTOP 65536 // 0x00010000L
Function Main()
LOCAL oDlg, oBtn[3]
DEFINE DIALOG oDlg FROM 0,0 TO 300,500 PIXEL TRUEPIXEL
@ 30, 30 BUTTONBMP oBtn[1] PROMPT "&One" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("One")
@ 30, 90 BUTTONBMP oBtn[2] PROMPT "&Two" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("Two - without TabStop")
@ 30,150 BUTTONBMP oBtn[3] PROMPT "&Three" OF oDlg PIXEL SIZE 50,30 ACTION MsgInfo("Three")
oBtn[2]:nStyle:= nOR(WS_CHILD, WS_VISIBLE)
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
#include "FiveWin.ch"
Function Main()
LOCAL oDlg, oBtn[3]
DEFINE DIALOG oDlg RESOURCE "TEST"
REDEFINE BUTTONBMP oBtn[1] PROMPT "&One" ID 201 OF oDlg ACTION MsgInfo("One")
REDEFINE BUTTONBMP oBtn[2] PROMPT "&Two" ID 202 OF oDlg ACTION MsgInfo("Two - Without TabStop")
REDEFINE BUTTONBMP oBtn[3] PROMPT "&Three" ID 203 OF oDlg ACTION MsgInfo("Three")
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
TEST DIALOG DISCARDABLE 6, 15, 223, 66
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "TXBrowse demo"
FONT 8, "MS Sans Serif"
{
CONTROL "&One", 201, "Button", WS_TABSTOP, 15, 16, 50, 20
CONTROL "&Two", 202, "Button", 0x00000000, 72, 16, 50, 20 // <== Look this line for No TabStop
CONTROL "&Three", 203, "Button", WS_TABSTOP, 129, 16, 50, 20
}
Cgallegoa wrote:Hi,
TestBmp.prg
- Code: Select all Expand view
#include "FiveWin.ch"
Function Main()
LOCAL oDlg, oBtn[3]
DEFINE DIALOG oDlg RESOURCE "TEST"
REDEFINE BUTTONBMP oBtn[1] PROMPT "&One" ID 201 OF oDlg ACTION MsgInfo("One")
REDEFINE BUTTONBMP oBtn[2] PROMPT "&Two" ID 202 OF oDlg ACTION MsgInfo("Two - Without TabStop")
REDEFINE BUTTONBMP oBtn[3] PROMPT "&Three" ID 203 OF oDlg ACTION MsgInfo("Three")
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
TestBmp.rc
- Code: Select all Expand view
TEST DIALOG DISCARDABLE 6, 15, 223, 66
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "TXBrowse demo"
FONT 8, "MS Sans Serif"
{
CONTROL "&One", 201, "Button", WS_TABSTOP, 15, 16, 50, 20
CONTROL "&Two", 202, "Button", 0x00000000, 72, 16, 50, 20 // <== Look this line for No TabStop
CONTROL "&Three", 203, "Button", WS_TABSTOP, 129, 16, 50, 20
}
Working fine too.
? oBtn:WinStyle( WS_TABSTOP ) --> lActive
oBtn:WinStyle( WS_TABSTOP, .T. (or) .F. ) // Enable/Disable the TabStop style
nageswaragunupudi wrote:
- Code: Select all Expand view
? oBtn:WinStyle( WS_TABSTOP ) --> lActive
oBtn:WinStyle( WS_TABSTOP, .T. (or) .F. ) // Enable/Disable the TabStop style
karinha wrote:wartiaga, explique em português o que você realmente quer fazer no segundo botão, você quer ligar/desligar depois de uma ação do programa(ACTION)? é isso? Qual a razão de ligar/desligar o TABSTOP de um botão? Sinceramente não entendi qual o objetivo disto!
SDS,
Regards, saludos.
Tenho 2 opções no meu sistema que utiliza essa mesma dialog.
IF DeOndeVem = "OPCAO1"
DEFINE BUTTON... WHEN(..) // Hide/Enable()/Disable(), etc.
ELSE
DEFINE BUTTON ... WHEN(..)
ENDIF
//-> ESTA EM C:\GERAL GERAL.EXE - HENNING LEGAL. GOSTEI
SEPARATOR
MENUITEM "Pedidos de Compras(Cliente) " ;
RESOURCE "ESTOQUE17" COLORRIGHT CLR_HBLUE BOLD ;
ACTION( COMPRAS( DeOndeVem := [CLIENTES] ) ) ;
MESSAGE "Manutenção dos Pedidos de Compras "+ ;
"Por Cliente. "
//-> ESTA EM C:\GERAL GERAL.EXE - HENNING LEGAL. GOSTEI
SEPARATOR
MENUITEM "Pedidos de Compras(Fornec.) " ;
RESOURCE "ESTOQUE18" COLORRIGHT CLR_HBLUE BOLD ;
ACTION( COMPRAS( DeOndeVem := [FORNECE] ) ) ;
MESSAGE "Manutenção dos Pedidos de Compras "+ ;
"Por Fornecedor."
FUNCTION COMPRAS( DeOndeVem )
IF DeOndeVem = [FORNECE]
REDEFINE SENSITIVE SAY aSayCliente VAR oSayFornece ID 403 OF oDlg COLOR CLR_CYAN UPDATE RIGHT FONT oFnt TRANSPARENT
//-> Codigo do Fornecedor - XCODFORNE
REDEFINE GET aGet[3] VAR XCODFORNE PICTURE "@K 999999999999" ;
ID 22 OF oDlg FONT oFnt UPDATE BITMAP "BUSCAR" ;
COLOR nRGB( 000, 000, 000 ), nRGB( 243, 250, 200 ) ;
ACTION( MOSTRAR_FORNECEDOR( XCODFORNE, aGet, DbCompras, ;
DbClientes, DbFornece, DbEstoque, DbObserva ) ) ;
VALID ( PESQUISA_FORNECEDOR( XCODFORNE, aGet, DbCompras, ;
DbClientes, DbFornece, DbEstoque, DbObserva ) ) ;
WHEN( lCodFornece )
aGet[3]:lBtnTransparent := .T. // transparent button
aGet[3]:bKeyDown := { |nKey| IF( nKey == VK_F7, Eval( aGet[3]:bAction ), Nil ) }
aGet[3]:cToolTip := OemToAnsi( "Digite o C¢digo do Fornecedor " )
ENDIF
IF DeOndeVem = [CLIENTES]
REDEFINE SENSITIVE SAY aSayCliente VAR oSayCliente ID 403 OF oDlg COLOR CLR_CYAN UPDATE RIGHT FONT oFnt TRANSPARENT
//-> Codigo do Fornecedor - XCODFORNE
REDEFINE GET aGet[3] VAR XCODFORNE PICTURE "@K 999999999999" ;
ID 22 OF oDlg FONT oFnt UPDATE BITMAP "BUSCAR" ;
COLOR nRGB( 000, 000, 000 ), nRGB( 243, 250, 200 ) ;
VALID ( PESQUISA_CLIENTES( XCODFORNE, ;
aGet, DbCompras, DbClientes, DbFornece, DbEstoque, DbObserva ) ) ;
ACTION( MOSTRAR_CLIENTES( XCODFORNE, ;
aGet, DbCompras, DbClientes, DbFornece, DbEstoque, DbObserva ) ) ;
WHEN( lCodFornece )
aGet[3]:lBtnTransparent := .T. // transparent button
aGet[3]:bKeyDown := { |nKey| IF( nKey == VK_F7, Eval( aGet[3]:bAction ), Nil ) }
aGet[3]:cToolTip := OemToAnsi( "Digite o C¢digo do Fornecedor " )
ENDIF
karinha wrote:Tenho 2 opções no meu sistema que utiliza essa mesma dialog.
LOCAL DeOndeVem
Dispara do MENU com DeOndeVem e controla na função.
Como você parte(DeOndeVem) do Menu?
- Code: Select all Expand view
IF DeOndeVem = "OPCAO1"
DEFINE BUTTON... WHEN(..) // Hide/Enable()/Disable(), etc.
ELSE
DEFINE BUTTON ... WHEN(..)
ENDIF
Sds.
Regards, saludos.
IF lAppend // SE FOR UMA INCLUSAO DE PROPOSTA, ENTRAR AQUI.
ACTIVATE DIALOG oDlg NOWAIT ;
ON INIT( XFOCUS( aGet[1] ) ) ;
VALID( !GETKEYSTATE( 27 ) )
ELSE // ALTERACAO DE PROPOSTA, ENTRAR AQUI.
/*
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT( XFOCUS( aGet[3] ) )
*/
ACTIVATE DIALOG oDlg NOWAIT ; // MDI pedido pela LEDA.
ON INIT( XFOCUS( aGet[3] ) ) ; // 3
VALID( !GETKEYSTATE( 27 ) )
ENDIF
ACTIVATE WINDOW oWndChild
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 76 guests