exemplo usando classe
Moderador: Moderadores
-
mmarcondes
- Usuário Nível 2

- Mensagens: 81
- Registrado em: 02 Jul 2021 15:06
- Localização: witmarsum
exemplo usando classe
por favor, pesquisei bastante pela internet mas não encontrei nenhum exemplo usando hwgui com classe.
eu já li aqui no fórum que um programador fez todo o sistema desse modo, se não me engano ele é de porto alegre, eu queria saber como faz uma tela, botão, um cadastro simples, relatório, essas coisas normais pra depois sozinho ir avançando.
agradeço qualquer ajuda, obrigado.
eu já li aqui no fórum que um programador fez todo o sistema desse modo, se não me engano ele é de porto alegre, eu queria saber como faz uma tela, botão, um cadastro simples, relatório, essas coisas normais pra depois sozinho ir avançando.
agradeço qualquer ajuda, obrigado.
-
Fernando queiroz
- Usuário Nível 4

- Mensagens: 779
- Registrado em: 13 Nov 2014 00:41
- Localização: Porto Alegre/RS
exemplo usando classe
CODIGO BEM SIMPLES USANDO CLASSES E HWGUI
Código: Selecionar todos
/*
TITULO : SISTEMA DE GESTÇO DE COMERCIO
DATA : 16/09/2020
PROGRAMA : lembrete.PRG
COMENTARIO : UTILITARIOS ( LEMBRETE )
*/
#include "hwgui.ch"
#include "hbclass.ch"
#include "cores.CH"
CREATE CLASS LembreteClass
VAR oServer
METHOD New( ParamServer ) INLINE ::oServer := ParamServer, Self
METHOD LEMBRETE( )
PROTECTED:
VAR cRichedit1 INIT ""
METHOD LEMBRETE_onDlgInit( oDlg )
METHOD LEMBRETE_onKeyDown( oBrowse1, nKeyPress, oDlg, cProgressKey )
METHOD LEMBRETE_EXCLUI( oDlg )
METHOD LEMBRETE_MANUTENCAO( cAcao, cLembrete_Id )
METHOD LEMBRETE_CARREGA( cConsulta )
METHOD LEMBRETE_SALVA( cAcao, cLembrete_Id )
ENDCLASS
*********************************************************************************************************************************************************
METHOD LEMBRETE( ) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL oDlg ;
, oLabel4;
, oBrowse1 ;
, oColuna;
, cProgressKey:="";
, cConsulta:="";
, oPanel1;
, oOwnerbutton1, oOwnerbutton2, oOwnerbutton3, oOwnerbutton4;
, oStatus1;
INIT DIALOG oDlg TITLE "NOTAS" ;
ICON HIcon():Addresource('SGC_ICON') ;
AT 0, 0 SIZE 1024,590 CLIPPER NOEXIT ;
ON INIT {|| oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta ), oBrowse1:REFRESH(), ::LEMBRETE_onDlgInit( oDlg ) };
BACKCOLOR 16777215
@ 0,0 PANEL oPanel1 SIZE 1024,80
oPanel1:oStyle := PainelGradienteColor
oPanel1:Anchor := 130
@ 2,83 SAY oLabel4 CAPTION "" SIZE 1020,30 ;
STYLE WS_BORDER + SS_CENTER;
COLOR 16777215 BACKCOLOR 0 ;
FONT HFont():Add( '',0,-19,400,,,)
oLabel4:Anchor:=130
@ 2,113 BROWSE oBrowse1 ARRAY OF oDlg SIZE 1020,456 STYLE WS_BORDER + WS_VSCROLL +WS_HSCROLL ;
ON SIZE ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS ;
ON KEYDOWN {|oBrowse1,nKeyPress| ::LEMBRETE_onKeyDown( oBrowse1, nKeyPress, oDlg, @cProgressKey ) }
oBrowse1:nHeadRows := 2
oBrowse1:oStyleHead := BrowseStyleHead
oBrowse1:headColor := BrowseheadColor
oBrowse1:oFont := HFont():Add( '',0,-16,700,,,)
// oBrowse1:freeze := 1
oBrowse1:aArray := {}
oBrowse1:AddColumn( HColumn():New('Notas', hwg_ColumnArBlock() ,'C',124, 0 ,.F.,1,,,,,,,,,,,))
oBrowse1:AddColumn( HColumn():New('Operador/Computador DATA/HORA', hwg_ColumnArBlock() ,'C',60, 0 ,.F.,,,,,,,,))
FOR EACH oColuna IN oBrowse1:aColumns
oColuna:bColorBlock := {|| BrowseBarColorPrimary }
NEXT
@ 5,9 OWNERBUTTON oOwnerbutton1 OF oPanel1 SIZE 73,63;
ON CLICK {|| ::LEMBRETE_MANUTENCAO( "INCLUIR", ), oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta ), ::LEMBRETE_onDlgInit( oDlg ), obrowse1:REFRESH()};
FLAT ;
TEXT 'Inclui' COLOR 16777215 ;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('add-file-256-30') ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Incluir nova Nota'
oOwnerbutton1:aStyle := OwnerbuttonStyle
@ 81,9 OWNERBUTTON oOwnerbutton2 OF oPanel1 SIZE 73,63;
ON CLICK {|| ::LEMBRETE_MANUTENCAO( "ALTERAR" ,LTRIM(str(oDlg:oBrowse1:aArray[ oDlg:oBrowse1:nCurrent, 3])) ), oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta ), obrowse1:REFRESH()};
FLAT ;
TEXT 'Edita' COLOR 16777215 ;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('edit-property-256-30') ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Editar Nota'
oOwnerbutton2:aStyle := OwnerbuttonStyle
@ 157,9 OWNERBUTTON oOwnerbutton3 OF oPanel1 SIZE 73,63;
ON CLICK {|| ::LEMBRETE_EXCLUI( oDlg ), oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta ), ::LEMBRETE_onDlgInit( oDlg ), obrowse1:REFRESH() };
FLAT ;
TEXT 'Exclui' COLOR 16777215 ;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('delete-256-30') ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Excluir Nota'
oOwnerbutton3:aStyle := OwnerbuttonStyle
@ 233,9 OWNERBUTTON oOwnerbutton4 OF oPanel1 SIZE 73,63 ;
ON CLICK {|| oDlg:Close() };
FLAT ;
TEXT 'Sair' COLOR 16777215 ;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('door-8-256-30') ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Sair da Rotina'
oOwnerbutton4:aStyle := OwnerbuttonStyle
ADD STATUS oStatus1 TO oDlg PARTS 200,800
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
*********************************************************************************************************************************************************
METHOD LEMBRETE_CARREGA( cConsulta ) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL aResult :={};
, oQuery;
, cQuery
cQuery := "SELECT "
cQuery += "lembrete.DESCRICAO, "
cQuery += "lembrete.QUEM_BLOQ, "
cQuery += "lembrete.LEMBRETE_ID "
cQuery += "FROM lembrete "
cQuery += cConsulta
cQuery += " ORDER BY lembrete.DESCRICAO "
oQuery := CONECCOESCLASS():ExecuteSQL(::oServer, cQuery)
if ! oQuery:Eof()
aResult := InverseArray( oQuery:GetRows() )
endif
RETURN aResult
*********************************************************************************************************************************************************
METHOD LEMBRETE_onDlgInit( oDlg ) CLASS LembreteClass
*********************************************************************************************************************************************************
IF ! EMPTY(oDlg:oBrowse1:aArray)
IF strzero(M->NIV_ACESSO,1,0)$"89"
oDlg:oPanel1:oOwnerbutton1:ENABLE()
oDlg:oPanel1:oOwnerbutton2:ENABLE()
oDlg:oPanel1:oOwnerbutton3:ENABLE()
ELSE
oDlg:oPanel1:oOwnerbutton1:ENABLE()
oDlg:oPanel1:oOwnerbutton2:ENABLE()
oDlg:oPanel1:oOwnerbutton3:DISABLE()
ENDIF
ELSE
oDlg:oPanel1:oOwnerbutton2:DISABLE()
oDlg:oPanel1:oOwnerbutton3:DISABLE()
ENDIF
hwg_WriteStatus( oDlg,1,"Tabela: LEMBRETE" )
hwg_WriteStatus( oDlg,2,"Ordem: Notas")
RETURN Nil
*********************************************************************************************************************************************************
METHOD LEMBRETE_EXCLUI( oDlg) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL cQuery;
, cQuery1;
, oQuery1;
IF hwg_MsgYesNo("DESEJA excluir a Nota, Tem certeza disso ?","Excluindo Nota")
IF strzero(M->NIV_ACESSO,1,0)$"89"
oQuery1 := CONECCOESCLASS():ExecuteSQL(::oServer, "SELECT lembrete.DESCRICAO FROM lembrete WHERE LEMBRETE_Id='" + LTRIM(str(oDlg:oBrowse1:aArray[ oDlg:oBrowse1:nCurrent, 3])) + "'")
cQuery1:="DELETE FROM Lembrete WHERE LEMBRETE_Id='" + LTRIM(str(oDlg:oBrowse1:aArray[ oDlg:oBrowse1:nCurrent, 3])) + "'"
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery1)
cQuery:=[INSERT INTO logtrans (logtrans.OPERADOR, logtrans.COMPUTADOR, logtrans.TEXTO ) VALUES ( "] + M->OPERADOR + [", "] + rtrim(hwg_GetComputerName()) + [", "] ;
+ cQuery1 + (oDlg:oBrowse1:aArray[ oDlg:oBrowse1:nCurrent, 1]) + [-] + oQuery1:Fields( "DESCRICAO" ):Value + [")]
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery)
endif
ENDIF
RETURN NIL
*********************************************************************************************************************************************************
METHOD LEMBRETE_onKeyDown( oBrowse1, nKeyPress, oDlg, cProgressKey ) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL nPosicao:=0;
, cConsulta;
, cProgressKey1;
KSETCAPS(.T.);
IF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ "34|33|37|38|39|40|20|16"
cProgressKey:=""
oDlg:oLabel4:settext(cProgressKey)
RETURN .T.
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [90]
nKeyPress := 90
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [96]
nKeyPress := 48
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [97]
nKeyPress := 49
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [98]
nKeyPress := 50
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [99]
nKeyPress := 51
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [100]
nKeyPress := 52
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [101]
nKeyPress := 53
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [102]
nKeyPress := 54
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [103]
nKeyPress := 55
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [104]
nKeyPress := 56
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [105]
nKeyPress := 57
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [106]
nKeyPress := 42
ELSEIF nKeyPress # 8 .AND. AllTrim(Str(nKeyPress)) $ [190]
nKeyPress := 46
ELSEIF nKeyPress == Asc("8") .AND. hwg_isCtrlShift( .F.,.T. )
nKeyPress := 42
ENDIF
IF nKeyPress = VK_ESCAPE
oDlg:Close()
RETURN .T.
ENDIF
If nKeyPress # 8
cProgressKey += Chr(nKeyPress)
nPosicao:=AScan(oDlg:oBrowse1:aArray,cProgressKey)
oDlg:oLabel4:settext(cProgressKey)
cProgressKey1 := STRTRAN(cProgressKey," ","%")
cConsulta:= "WHERE lembrete.DESCRICAO LIKE '%" + cProgressKey1 + "%' "
oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta )
oDlg:obrowse1:REFRESH()
ELSEIF nKeyPress = 8 .AND. Len(cProgressKey) >= 1
cProgressKey:=Left(cProgressKey,Len(cProgressKey) - 1)
nPosicao:=AScan(oDlg:oBrowse1:aArray,cProgressKey)
oDlg:oLabel4:settext(cProgressKey)
cProgressKey1 := STRTRAN(cProgressKey," ","%")
cConsulta:= "WHERE lembrete.DESCRICAO LIKE '%" + cProgressKey1 + "%' "
oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta )
oDlg:obrowse1:REFRESH()
ENDIF
IF nPosicao # 0
cProgressKey1 := STRTRAN(cProgressKey," ","%")
cConsulta:= "WHERE lembrete.DESCRICAO LIKE '%" + cProgressKey1 + "%' "
oBrowse1:aArray := ::LEMBRETE_CARREGA( cConsulta )
oDlg:obrowse1:REFRESH()
ENDIF
return .T.
*********************************************************************************************************************************************************
METHOD LEMBRETE_MANUTENCAO( cAcao, cLembrete_Id ) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL oDlg;
, cQuery;
, oQuery;
, oOwnerbutton1, oOwnerbutton2;
, oRichedit1;
, oLabel53;
, oPanel1, oPanel2;
, oStatus1;
IF cAcao = "INCLUIR"
::cRichedit1:=""
ELSE
cQuery := [SELECT lembrete.DESCRICAO FROM lembrete WHERE LEMBRETE_ID = '] + cLembrete_Id + [']
oQuery := CONECCOESCLASS():ExecuteSQL(::oServer, cQuery)
::cRichedit1:=oQuery:Fields( "DESCRICAO" ):Value
ENDIF
INIT DIALOG oDlg TITLE "NOTAS" ;
ICON HIcon():Addresource('SGC_ICON') ;
AT 0, 0 SIZE 1024,590 CLIPPER NOEXIT;
ON INIT {|| oRichedit1:setfocus() };
BACKCOLOR 0
@ 0,0 PANEL oPanel1 SIZE 1024,80
oPanel1:oStyle := PainelGradienteColor
oPanel1:Anchor := 130
@ 0,113 PANEL oPanel2 SIZE 1024,456 BACKCOLOR 16777215
oPanel2:Anchor:=130
@ 5,9 OWNERBUTTON oOwnerbutton1 OF oPanel1 SIZE 73,63 FLAT ;
TEXT 'Salvar' COLOR 16777215;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('save-as-256-30') ;
COORDINATES 0, 5, 0, 0;
TOOLTIP 'Salvar Nota';
ON CLICK {|| ::LEMBRETE_SALVA( cAcao, cLembrete_Id ), hwg_Enddialog() }
oPanel1:oOwnerbutton1:aStyle := OwnerbuttonStyle
@ 81,9 OWNERBUTTON oOwnerbutton2 OF oPanel1 SIZE 73,63 ;
ON CLICK {|| oDlg:Close() };
FLAT ;
TEXT 'Sair' COLOR 16777215 ;
COORDINATES 0, 40, 0, 0 ;
BITMAP HBitmap():Addresource('door-8-256-30') ;
COORDINATES 0, 5, 0, 0 ;
TOOLTIP 'Sair da Rotina'
oOwnerbutton2:aStyle := OwnerbuttonStyle
@ 1,85 SAY oLabel53 CAPTION "" SIZE 1024,25 ;
STYLE WS_BORDER + SS_CENTER;
COLOR 16777215 BACKCOLOR 0
oLabel53:Anchor:=130
@ 2,118 RICHEDIT oRichedit1 TEXT ::cRichedit1 SIZE 1020,420 ;
STYLE ES_MULTILINE +WS_BORDER+ES_WANTRETURN+ES_AUTOVSCROLL +WS_VSCROLL ;
ON INIT {|| oRichedit1:GETTEXT( ::cRichedit1 )} ;
ON LOSTFOCUS {|| ::cRichedit1:=oRichedit1:GETTEXT( )} ;
FONT HFont():Add( '',0,-19,700,,,)
oRichedit1:Anchor:=130
ADD STATUS oStatus1 TO oDlg PARTS 200,800
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
*********************************************************************************************************************************************************
METHOD LEMBRETE_SALVA( cAcao, cLembrete_Id ) CLASS LembreteClass
*********************************************************************************************************************************************************
LOCAL cQuery;
, cQuery1;
IF cAcao = 'INCLUIR'
cQuery1:="INSERT INTO lembrete ( lembrete.DESCRICAO, lembrete.QUEM_BLOQ ) VALUES ('" + ::cRichedit1 + "', '" + rtrim(M->OPERADOR)+"/"+rtrim(hwg_GetComputerName()+" ["+dtoc(date())+" "+time()+"]") + "') "
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery1 )
cQuery:=[INSERT INTO logtrans (logtrans.OPERADOR, logtrans.COMPUTADOR, logtrans.TEXTO ) VALUES ( "] + rtrim(M->OPERADOR) +[", "] + rtrim(hwg_GetComputerName()) + [", "] + cQuery1 + [")]
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery)
ELSE
IF strzero(M->NIV_ACESSO,1,0)$"89"
cQuery1:=[UPDATE lembrete SET lembrete.DESCRICAO = '] + ::cRichedit1 + [', lembrete.QUEM_BLOQ = '] + rtrim(M->OPERADOR)+"/"+rtrim(hwg_GetComputerName()+" ["+dtoc(date())+" "+time()+"]") + [' WHERE LEMBRETE_Id = '] + cLembrete_Id + [']
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery1 )
cQuery:=[INSERT INTO logtrans (logtrans.OPERADOR, logtrans.COMPUTADOR, logtrans.TEXTO ) VALUES ( "] + rtrim(M->OPERADOR) +[", "] + rtrim(hwg_GetComputerName()) + [", "] + cQuery1 + [")]
CONECCOESCLASS():ExecuteSQL(::oServer, cQuery)
endif
ENDIF
return NIL
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
-
Fernando queiroz
- Usuário Nível 4

- Mensagens: 779
- Registrado em: 13 Nov 2014 00:41
- Localização: Porto Alegre/RS
exemplo usando classe
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
-
mmarcondes
- Usuário Nível 2

- Mensagens: 81
- Registrado em: 02 Jul 2021 15:06
- Localização: witmarsum
- deividdjs
- Usuário Nível 3

- Mensagens: 377
- Registrado em: 19 Set 2006 09:39
- Localização: Foz do Iguaçu / Pr
exemplo usando classe
Bom dia Fernando .. blz ?
vi q vc desenvolveu um aplicativo em legal em hwgui .. uma pergunta se puder me ajudar .. como que tu controla os tamanhos de telas para ficar responsivo em vários tamanhos e resoluções de monitores ?? ou vc tem um tamanho standard (padrão) para sua form main incial ?? como é isso em hwgui ??
Abraço!
vi q vc desenvolveu um aplicativo em legal em hwgui .. uma pergunta se puder me ajudar .. como que tu controla os tamanhos de telas para ficar responsivo em vários tamanhos e resoluções de monitores ?? ou vc tem um tamanho standard (padrão) para sua form main incial ?? como é isso em hwgui ??
Abraço!
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
-
Fernando queiroz
- Usuário Nível 4

- Mensagens: 779
- Registrado em: 13 Nov 2014 00:41
- Localização: Porto Alegre/RS
exemplo usando classe
Eu trabalho com a tela mínima de 1366x768deividdjs escreveu:Bom dia Fernando .. blz ?
vi q vc desenvolveu um aplicativo em legal em hwgui .. uma pergunta se puder me ajudar .. como que tu controla os tamanhos de telas para ficar responsivo em vários tamanhos e resoluções de monitores ?? ou vc tem um tamanho standard (padrão) para sua form main incial ?? como é isso em hwgui ??
Abraço!
nao é responsivo o que eu consigo fazer é ajustar para telas maiores , mas os ícones e as letras continuam com o mesmo tamanho
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
-
alxsts
- Colaborador

- Mensagens: 3092
- Registrado em: 12 Ago 2008 15:50
- Localização: São Paulo-SP-Brasil
exemplo usando classe
Olá!
Talvez esteja confundindo responsividade com redimensionamento de componentes ao redimensionar a tela. Estude e teste o exemplo "Anchors" no Tutorial da HwGUI.deividdjs escreveu:como que tu controla os tamanhos de telas para ficar responsivo em vários tamanhos e resoluções de monitores ?? ou vc tem um tamanho standard (padrão) para sua form main incial ?? como é isso em hwgui ?
Código: Selecionar todos
//
#include "hwgui.ch"
#define CLR_GREEN1 0xcaebba
Function Test()
Local oDlg, oFont
#ifdef __GTK__
oFont := HFont():Add( "Sans", 0, 12 )
#else
oFont := HFont():Add( "MS Sans Serif", 0, 14 )
#endif
INIT DIALOG oDlg TITLE "Anchors" AT 0, 0 SIZE 420, 400
@ 10, 10 SAY "Try to rezize the window to see how the controls will react" SIZE 400, 22
@ 20,40 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_LEFTABS" ;
ON SIZE ANCHOR_LEFTABS
@ 160,40 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_LEFTABS+ANCHOR_RIGHTABS+ANCHOR_TOPABS+ANCHOR_BOTTOMABS" ;
ON SIZE ANCHOR_LEFTABS+ANCHOR_RIGHTABS+ANCHOR_TOPABS+ANCHOR_BOTTOMABS
@ 300,40 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_RIGHTABS" ;
ON SIZE ANCHOR_RIGHTABS
@ 20,190 SAY "Rel" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_LEFTREL" ;
ON SIZE ANCHOR_LEFTREL
@ 160,190 SAY "Rel" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_LEFTREL+ANCHOR_RIGHTREL+ANCHOR_TOPREL+ANCHOR_BOTTOMREL" ;
ON SIZE ANCHOR_LEFTREL+ANCHOR_RIGHTREL+ANCHOR_TOPREL+ANCHOR_BOTTOMREL
@ 300,190 SAY "Rel" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_RIGHTREL" ;
ON SIZE ANCHOR_RIGHTREL
@ 20,280 SAY "FIX" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_HORFIX" ;
ON SIZE ANCHOR_HORFIX
@ 160,280 SAY "FIX" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_VERTFIX" ;
ON SIZE ANCHOR_VERTFIX
@ 20,350 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_BOTTOMABS" ;
ON SIZE ANCHOR_BOTTOMABS
@ 160,350 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_LEFTABS+ANCHOR_RIGHTABS+ANCHOR_BOTTOMABS" ;
ON SIZE ANCHOR_LEFTABS+ANCHOR_RIGHTABS+ANCHOR_BOTTOMABS
@ 300,350 SAY "ABS" SIZE 100, 24 BACKCOLOR CLR_GREEN1 STYLE DT_CENTER TOOLTIP "ANCHOR_RIGHTABS + ANCHOR_BOTTOMABS" ;
ON SIZE ANCHOR_RIGHTABS+ANCHOR_BOTTOMABS
ACTIVATE DIALOG oDlg
Return Nil[]´s
Alexandre Santos (AlxSts)
Alexandre Santos (AlxSts)
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
exemplo usando classe
Nesse ponto GTWVG é imbatível.
Já é conhecido:
Nem todo controle aceita redimensionamento, a não ser que seja destruído e recriado.
Ainda estou no começo dos testes de lib GUI não cheguei nessa parte.
Pretendo colocar o mesmo esquema da GTWVG.
É super, hiper, ultra fácil.
Sabem os controles ?
Eles são repintados quase 100% do tempo.
É só alterar essa rotina de repintura, os tamanhos de referência, ao repintar, será o tamanho novo.
O Fernando disse que usa tamanho 1366 x 768
Apenas teórico, na prática não pode ser bem assim:
Fator largura: 1920 / 1366
Faor altura: 1920 x 768
Repinta os controles com largura * FatorLargura e altura * FatorLargura.
E define tamanho de fonte proporcional à altura/largura.
Eu disse NA TEORIA
Na prática depende de onde vém o tamanho original.
Se é obtido o tamanho orignal por variável na classe ok, se é obtido do windows, aí ferrou, vai ampliar a cada repintura.
Os controles podem ficar deformados conforme a mudança, mudar pra tela quadrada por exemplo ?
Ué... Se o usuário deformar o tamanho de tela, vai obter o que pediu, tela formatada.
Lembrando também:
Aqui uso ampliação do Windows 150%
Nesta situação, o tamanho real do controle não é o mesmo que a LIB usou.
Se a LIB for pegar do Windows, dá merd.
Importante:
Lembro da Microsoft permitir este redimensionamento por aplicativo.
Será que ainda precisamos mesmo perder tempo com isso de redimensionar ?
Já é conhecido:
Nem todo controle aceita redimensionamento, a não ser que seja destruído e recriado.
Ainda estou no começo dos testes de lib GUI não cheguei nessa parte.
Pretendo colocar o mesmo esquema da GTWVG.
É super, hiper, ultra fácil.
Sabem os controles ?
Eles são repintados quase 100% do tempo.
É só alterar essa rotina de repintura, os tamanhos de referência, ao repintar, será o tamanho novo.
O Fernando disse que usa tamanho 1366 x 768
Apenas teórico, na prática não pode ser bem assim:
Fator largura: 1920 / 1366
Faor altura: 1920 x 768
Repinta os controles com largura * FatorLargura e altura * FatorLargura.
E define tamanho de fonte proporcional à altura/largura.
Eu disse NA TEORIA
Na prática depende de onde vém o tamanho original.
Se é obtido o tamanho orignal por variável na classe ok, se é obtido do windows, aí ferrou, vai ampliar a cada repintura.
Os controles podem ficar deformados conforme a mudança, mudar pra tela quadrada por exemplo ?
Ué... Se o usuário deformar o tamanho de tela, vai obter o que pediu, tela formatada.
Lembrando também:
Aqui uso ampliação do Windows 150%
Nesta situação, o tamanho real do controle não é o mesmo que a LIB usou.
Se a LIB for pegar do Windows, dá merd.
Importante:
Lembro da Microsoft permitir este redimensionamento por aplicativo.
Será que ainda precisamos mesmo perder tempo com isso de redimensionar ?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- deividdjs
- Usuário Nível 3

- Mensagens: 377
- Registrado em: 19 Set 2006 09:39
- Localização: Foz do Iguaçu / Pr
exemplo usando classe
bom dia Prezados .. alguém sabe porque quando compilo meu aplicado fica uma tela de console junto aberta ??
abraço,
Deivid
abraço,
Deivid
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
exemplo usando classe
Sim
Mas está compilando somente fonte hwgui ?
Acrescente -gtgui
Mas está compilando somente fonte hwgui ?
Acrescente -gtgui
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- deividdjs
- Usuário Nível 3

- Mensagens: 377
- Registrado em: 19 Set 2006 09:39
- Localização: Foz do Iguaçu / Pr
exemplo usando classe
perfeito zé .. resolveu!! obrigado!
Abraço!
Abraço!
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX