by j.fmagalhaes » Sat Aug 27, 2011 1:36 pm
Boa tarde
Veja o exemplo abaixo. Funciona bem.
Ficheiro Prg
dbSelectArea("PRO")
PRO->(OrdSetFocus("DDATA"))
DEFINE DIALOG oDlg RESOURCE DIALOG_1 TITLE (Titulo)
REDEFINE LISTBOX oLbx;
FIELDS dtoc(PRO->DDATA), PRO->VENDE;
FIELDSIZES 60, 70;
HEADERS "Data", "Vendedor";
ON CHANGE (d_Data:=PRO->DDATA,c_Vend:=alltrim(UPPER(PRO->Vende)),c_Prog:=PRO->Proga,c_Efec:=PRO->Efect,;
oSay[1]:refresh(),oSay[2]:refresh(),oSay[3]:refresh(),oSay[4]:refresh());
ID 104 OF oDlg;
UPDATE
REDEFINE GET oSay[1] VAR d_Data ID 110 OF oDlg UPDATE COLOR Cor1,Cor2
REDEFINE COMBOBOX oSay[2] VAR c_Vend ITEMS cVende ID 111 OF oDlg UPDATE COLOR Cor1,Cor2
REDEFINE GET oSay[3] VAR c_Prog ID 108 of oDlg MEMO UPDATE COLOR Cor1,Cor2
REDEFINE GET oSay[4] VAR c_Efec ID 109 of oDlg MEMO UPDATE COLOR Cor1,Cor2
REDEFINE BUTTON ID 106 OF oDlg ACTION (Seguir := .T., oDlg:End())
REDEFINE BUTTON ID 107 OF oDlg ACTION (Seguir := .F., oDlg:End())
ACTIVATE DIALOG oDlg CENTERED
IF ! Seguir
Return Nil
else
endif
Ficheiro RC para o DIALOG_1
DIALOG_1 DIALOG 6, 15, 427, 236
STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
CAPTION "Introduzir/Alterar Ficheiro do Programa Diário"
FONT 8, "MS Sans Serif"
{
CONTROL "", IDC_GROUPBOX1, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 4, 6, 150, 189
CONTROL "", IDC_EDIT2, "EDIT", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 10, 16, 139, 173
CONTROL "Dados", IDC_GROUPBOX2, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 160, 6, 261, 189
CONTROL "Data", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 170, 24, 20, 8
CONTROL "", IDC_EDIT3, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 196, 20, 50, 12
CONTROL "Comercial", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 260, 24, 35, 8
CONTROL "", IDC_COMBOBOX2, "COMBOBOX", CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 308, 20, 107, 55
CONTROL "Programado para o dia", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 170, 38, 79, 8
CONTROL "", IDC_EDIT4, "EDIT", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 170, 47, 244, 65
CONTROL "Efectuado", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 170, 115, 36, 8
CONTROL "", IDC_EDIT5, "EDIT", ES_LEFT | ES_MULTILINE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_TABSTOP, 170, 124, 244, 65
CONTROL "Opções", IDC_GROUPBOX3, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 4, 201, 417, 30
CONTROL "&Ok", IDC_PUSHBUTTON1, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 162, 211, 50, 14
CONTROL "&Sair", IDC_PUSHBUTTON2, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 219, 211, 50, 14
}
Cumprimentos
JMagalhaes