Página 1 de 1

Como se adicionam rotinas de resize

Enviado: 06 Nov 2021 18:05
por JoséQuintas
Inicialmente é no button.
Como coloco rotina de redimensionamento?

Meu redimensionamento vai ser por linha/coluna, então não vai ser nenhum automático existente.
O ruim é que no Ownerbutton vai ter que redimensionar mais coisas além do tamanho do controle.

Como se adicionam rotinas de resize

Enviado: 06 Nov 2021 18:55
por alxsts
Olá!

Normalmente se utiliza a propriedade Anchor do controle...

Como se adicionam rotinas de resize

Enviado: 06 Nov 2021 19:38
por JoséQuintas
Ok.
Ajudou.

Código: Selecionar todos

   IF ValType( bSize ) == "N"
      ::Anchor := bSize
   ELSE
      ::bSize   := bSize
   ENDIF
Pode ser um codeblock no bSize.

Como se adicionam rotinas de resize

Enviado: 06 Nov 2021 20:22
por alxsts
Olá!


Veja em hwgui\include\guilib.ch as constantes manifestas que definem os tipos de ancoragem:

Código: Selecionar todos

#define ANCHOR_TOPLEFT         0   // Anchors control to the top and left borders of the container and does not change 
                                   // the distance between the top and left borders. (Default)
#define ANCHOR_TOPABS          1   // Anchors control to top border of container and does not change the distance between 
                                   // the top border.
#define ANCHOR_LEFTABS         2   // Anchors control to left border of container and does not change the distance between 
                                   // the left border.
#define ANCHOR_BOTTOMABS       4   // Anchors control to bottom border of container and does not change the distance between 
                                   // the bottom border.
#define ANCHOR_RIGHTABS        8   // Anchors control to right border of container and does not change the distance between 
                                   // the right border.
#define ANCHOR_TOPREL          16  // Anchors control to top border of container and maintains relative distance between 
                                   // the top border.
#define ANCHOR_LEFTREL         32  // Anchors control to left border of container and maintains relative distance between 
                                   // the left border.
#define ANCHOR_BOTTOMREL       64  // Anchors control to bottom border of container and maintains relative distance between 
                                   // the bottom border.
#define ANCHOR_RIGHTREL        128 // Anchors control to right border of container and maintains relative distance between 
                                   // the right border.
#define ANCHOR_HORFIX          256 // Anchors center of control relative to left and right borders 
                                   // but remains fixed in size.
#define ANCHOR_VERTFIX         512 // Anchors center of control relative to top and bottom borders but remains fixed in size.
Voce pode combinar os efeitos
Exemplo:
Se voce quer manter uma toolbar ocupando toda a largura do FORM ao maximizar ele USE anchor = 11 ( 11 ==> ANCHOR_TOPLEFT + ANCHOR_TOPABS + ANCHOR_LEFTABS + ANCHOR_RIGHTABS )
Se voce quer manter um botão sempre do lado direito do form mantendo sempre a mesma distancia da borda direita use anchor = 9
Luis Fernando Basso

Fonte: extraído do link postado anteriormente
HwGUI Anchor

Como se adicionam rotinas de resize

Enviado: 06 Nov 2021 21:42
por JoséQuintas
Naquele primeiro link tinha isso.

Pra ficar do jeito que eu quero vejo duas alternativas:

- linha/coluna
- favor de ampliação

Esse negócio de ficar ajustando manualmente é muito chato, parece voltar no tempo.
E essas que inventaram, acho que nenhuma funciona aqui.