Como impedir resize da dialog?

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Não encontrei aonde impedir resize da dialog.
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/
Fernando queiroz
Usuário Nível 4
Usuário Nível 4
Mensagens: 779
Registrado em: 13 Nov 2014 00:41
Localização: Porto Alegre/RS

Como impedir resize da dialog?

Mensagem por Fernando queiroz »

tenta assim

INIT DIALOG oDlg TITLE "Form1" ;
AT 527,122 SIZE 516,465 ;
STYLE WS_SYSMENU+WS_SIZEBOX+WS_VISIBLE
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Nenhum efeito.
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/
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
STYLE WS_CHILD

Deveria ser WS_NOSIZE sei lá...

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
Style CCS_NORESIZE
Assim também funciona.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
Assim tá mais certo, minha dialog de login:

Código: Selecionar todos

STYLE WS_OVERLAPPED + WS_VISIBLE + WS_SYSMENU + WS_CAPTION + WS_TABSTOP
Pq tem que aparecer o ICONE de uma chave e tinha sumido... Não percebi.

Código: Selecionar todos

cTitulo:="Local: " + IIF(Empty(cServidor),cDirDados,cServidor),  oIcon := HIcon():AddResource("ICON_4")
Mais ainda não tá bom... Mexendo aqui...

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
O bagulho é doido!

Código: Selecionar todos

STYLE WS_OVERLAPPED + WS_VISIBLE + WS_SYSMENU + WS_MAXIMIZEBOX + WS_CAPTION + WS_TABSTOP
Ficou com o ICONE + TITULO + MINIMIZAR e o X.
SE desligo o MINIMIZAR pode mudar o tamanho.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
Um problema que vi foi que depois de fechado a DIALOG a Janela principal, fica MINIMIZADA.
Fiz uma oFormaMain:Maximize() para resolver. Mas não gostei pq antes não precisava.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Fernando queiroz
Usuário Nível 4
Usuário Nível 4
Mensagens: 779
Registrado em: 13 Nov 2014 00:41
Localização: Porto Alegre/RS

Como impedir resize da dialog?

Mensagem por Fernando queiroz »

/*
* Window Styles
*/

#define WS_OVERLAPPED 0
#define WS_POPUP 2147483648 // 0x80000000L
#define WS_CHILD 1073741824 // 0x40000000L
#define WS_MINIMIZE 536870912 // 0x20000000L
#define WS_VISIBLE 268435456 // 0x10000000L
#define WS_DISABLED 134217728 // 0x08000000L
#define WS_CLIPSIBLINGS 67108864 // 0x04000000L
#define WS_CLIPCHILDREN 33554432
#define WS_MAXIMIZE 16777216 // 0x01000000L
#define WS_CAPTION 12582912 // 0x00C00000L

#define WS_BORDER 8388608 // 0x00800000L
#define WS_VSCROLL 2097152 // 0x00200000L
#define WS_HSCROLL 1048576 // 0x00100000L

#define WS_DLGFRAME 4194304 // 0x00400000L
#define WS_EX_STATICEDGE 131072 // 0x00020000L
#define WS_SYSMENU 524288 // 0x00080000L
#define WS_THICKFRAME 262144 // 0x00040000L
#define WS_GROUP 131072 // 0x00020000L
#define WS_TABSTOP 65536 // 0x00010000L
#define WS_MINIMIZEBOX 131072 // 0x00020000L
#define WS_MAXIMIZEBOX 65536 // 0x00010000L
#define WS_SIZEBOX WS_THICKFRAME
#define WS_OVERLAPPEDWINDOW WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX + WS_MAXIMIZEBOX
HARBOUR 3.2, HWGUI 2.23 B3, SEFAZCLASS, PDFClass, ADO + MariaDB/MySQL, RMChart
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

Como impedir resize da dialog?

Mensagem por Itamar M. Lins Jr. »

Olá!
Ai não explica nada.
Tem que ver no site da M$.
https://learn.microsoft.com/pt-br/windo ... dow-styles
Captura de tela 2023-02-14 091442.png
Captura de tela 2023-02-14 091442.png (9.82 KiB) Exibido 1894 vezes
Lógico que no site da Microsoft tem mais opções.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

https://learn.microsoft.com/en-us/windo ... dow-styles

Pois é, a LIB deveria fazer isso.
&nbspWS_BORDER&nbsp&nbsp0x00800000L&nbsp&nbspThe window has a thin-line border&nbsp
&nbspWS_CAPTION&nbsp&nbsp0x00C00000L&nbsp&nbspThe window has a title bar (includes the WS_BORDER style).&nbsp
&nbspWS_CHILD&nbsp&nbsp0x40000000L&nbsp&nbspThe window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.&nbsp
&nbspWS_CHILDWINDOW&nbsp&nbsp0x40000000L&nbsp&nbspSame as the WS_CHILD style.&nbsp
&nbspWS_CLIPCHILDREN&nbsp&nbsp0x02000000L&nbsp&nbspExcludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.&nbsp
&nbspWS_CLIPSIBLINGS&nbsp&nbsp0x04000000L&nbsp&nbspClips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.&nbsp
&nbspWS_DISABLED&nbsp&nbsp0x08000000L&nbsp&nbspThe window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function.&nbsp
&nbspWS_DLGFRAME&nbsp&nbsp0x00400000L&nbsp&nbspThe window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.&nbsp
&nbspWS_GROUP&nbsp&nbsp0x00020000L&nbsp&nbspThe window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function.&nbsp
&nbspWS_HSCROLL&nbsp&nbsp0x00100000L&nbsp&nbspThe window has a horizontal scroll bar.&nbsp
&nbspWS_ICONIC&nbsp&nbsp0x20000000L&nbsp&nbspThe window is initially minimized. Same as the WS_MINIMIZE style.&nbsp
&nbspWS_MAXIMIZE&nbsp&nbsp0x01000000L&nbsp&nbspThe window is initially maximized.&nbsp
&nbspWS_MAXIMIZEBOX&nbsp&nbsp0x00010000L&nbsp&nbspThe window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.&nbsp
&nbspWS_MINIMIZE&nbsp&nbsp0x20000000L&nbsp&nbspThe window is initially minimized. Same as the WS_ICONIC style.&nbsp
&nbspWS_MINIMIZEBOX&nbsp&nbsp0x00020000L&nbsp&nbspThe window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.&nbsp
&nbspWS_OVERLAPPED&nbsp&nbsp0x00000000L&nbsp&nbspThe window is an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.&nbsp
&nbspWS_OVERLAPPEDWINDOW&nbsp&nbspWS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX&nbsp&nbspThe window is an overlapped window. Same as the WS_TILEDWINDOW style.&nbsp
&nbspWS_POPUP&nbsp&nbsp0x80000000L&nbsp&nbspThe window is a pop-up window. This style cannot be used with the WS_CHILD style.&nbsp
&nbspWS_POPUPWINDOW&nbsp&nbsp(WS_POPUP | WS_BORDER | WS_SYSMENU)&nbsp&nbspThe window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.&nbsp
&nbspWS_SIZEBOX&nbsp&nbsp0x00040000L&nbsp&nbspThe window has a sizing border. Same as the WS_THICKFRAME style.&nbsp
&nbspWS_SYSMENU&nbsp&nbsp0x00080000L&nbsp&nbspThe window has a window menu on its title bar. The WS_CAPTION style must also be specified.&nbsp
&nbspWS_TABSTOP&nbsp&nbsp0x00010000L&nbsp&nbspThe window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function. For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.&nbsp
&nbspWS_THICKFRAME&nbsp&nbsp0x00040000L&nbsp&nbspThe window has a sizing border. Same as the WS_SIZEBOX style.&nbsp
&nbspWS_TILED&nbsp&nbsp0x00000000L&nbsp&nbspThe window is an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.&nbsp
&nbspWS_TILEDWINDOW&nbsp&nbsp(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)&nbsp&nbspThe window is an overlapped window. Same as the WS_OVERLAPPEDWINDOW style.&nbsp
&nbspWS_VISIBLE&nbsp&nbsp0x10000000L&nbsp&nbspThe window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function.&nbsp
&nbspWS_VSCROLL&nbsp&nbsp0x00200000L&nbsp&nbspThe window has a vertical scroll bar.&nbsp
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/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Talvez no evento SIZE, mas como isso é DEPOIS de redimensionar, precisa tratamento pra não travar tudo.
É... porque... pelo que imagino.... voltar ao tamanho normal acaba sendo outro resize.
E se não tomar cuidado vai causar um loop infinito.
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/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Código: Selecionar todos

   INIT DIALOG oDlg ;
      AT AppWindowRect( 1 ), AppWindowRect( 2 ) SIZE AppWindowRect( 3 ), AppWindowRect( 4 ) ;
      TITLE cTitle ;
      ON SIZE { || FixSize( oDlg ) }
...
STATIC FUNCTION FixSize( oDlg )

   LOCAL aPos := hwg_GetWindowRect( oDlg:Handle )

   hwg_MsgInfo( Str( oDlg:nTop ) + Str( oDlg:nLeft ) + Str( oDlg:nWidth ) + ", " + Str( oDlg:nHeight ) + hb_Eol() + ;
      Str( aPos[ 1 ] ) + Str( aPos[ 2 ] ) + Str( aPos[ 3 ] ) + Str( aPos[ 4 ] ) )

   RETURN Nil
Não ajudou nada, os tamanhos são os mesmos, só estranhei o momento em que aparece a mensagem.
size.png
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/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Agora é descobrir como usar a informação.

Código: Selecionar todos

STATIC FUNCTION FixSize( oDlg )

   LOCAL aPos := hwg_GetWindowRect( oDlg:Handle )

   WITH OBJECT oDlg
      IF :nWidth!= aPos[ 4 ] - aPos[ 2 ] .OR. :nHeight != aPos[ 3 ] - aPos[ 1 ]
         hwg_MsgInfo( Str( :nTop ) + Str( :nLeft ) + Str( :nWidth ) + ", " + Str( :nHeight ) + hb_Eol() + ;
            Str( aPos[ 1 ] ) + Str( aPos[ 2 ] ) + Str( aPos[ 3 ] ) + Str( aPos[ 4 ] ) )
      ENDIF
   ENDWITH

   RETURN .T.
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/
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

Como impedir resize da dialog?

Mensagem por JoséQuintas »

Código: Selecionar todos

STATIC FUNCTION FixSize( oDlg )

   LOCAL aPos := hwg_GetWindowRect( oDlg:Handle )

   WITH OBJECT oDlg
      IF :nWidth != aPos[ 4 ] - aPos[ 2 ] .OR. :nHeight != aPos[ 3 ] - aPos[ 1 ]
         hwg_MsgInfo( ;
            Str( :nTop ) + Str( :nLeft ) + hb_Eol() + ;
            Str( :nWidth ) + ", " + Str( :nHeight ) + hb_Eol() + ;
            Str( aPos[ 1 ] ) + Str( aPos[ 2 ] ) + hb_Eol() + ;
            Str( aPos[ 3 ] ) + Str( aPos[ 4 ] ) )
      ENDIF
   ENDWITH

   RETURN .T.
size.png
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/
Responder