Tem como definir um tamanho de form sem precisar de pixels?
É que vai ser chato encontrar um padrão.
Aqui tenho 3 monitores:
1600 x 900
1920 x 1080
3840 x 2160
e no cliente pode ter muitas outras
Tem alguma forma de definir, que não seja maximizado, ou não dependa de pixels?
Tem como definir forms sem usar pixels?
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Tem como definir forms sem usar pixels?
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/
Tem como definir forms sem usar pixels?
Tem que ser usando pixel, é bem simples, use o set autoadjust e quando criar uma janela, utilize coordenadas baseado na altura e largura máxima da tela.
Marcelo Neves
https://produto.mercadolivre.com.br/MLB ... 0067609615
whatsapp (41) 99786-3995
http://harbourdeveloper.blogspot.com
marcelo.souza.das.neves@gmail.com
https://produto.mercadolivre.com.br/MLB ... 0067609615
whatsapp (41) 99786-3995
http://harbourdeveloper.blogspot.com
marcelo.souza.das.neves@gmail.com
- sygecom
- Administrador

- Mensagens: 7131
- Registrado em: 21 Jul 2006 10:12
- Localização: Alvorada-RS
- Contato:
Tem como definir forms sem usar pixels?
Zé,
Aqui levamos como padrão 1024x768 na hora de fazer as telas e, na hwgui temos umas propriedades: Anchor que redimenciona a tela conforme o usuário aumenta ou diminui a tela que está.
ORing this bit values:
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)
ANCHOR_TOPABS 1 // Anchors control to top border of container and does not change the distance between the top border.
ANCHOR_LEFTABS 2 // Anchors control to left border of container and does not change the distance between the left border.
ANCHOR_BOTTOMABS 4 // Anchors control to bottom border of container and does not change the distance between the bottom border.
ANCHOR_RIGHTABS 8 // Anchors control to right border of container and does not change the distance between the right border.
ANCHOR_TOPREL 16 // Anchors control to top border of container and maintains relative distance between the top border.
ANCHOR_LEFTREL 32 // Anchors control to left border of container and maintains relative distance between the left border.
ANCHOR_BOTTOMREL 64 // Anchors control to bottom border of container and maintains relative distance between the bottom border.
ANCHOR_RIGHTREL 128 // Anchors control to right border of container and maintains relative distance between the right border.
ANCHOR_HORFIX 256 // Anchors center of control relative to left and right borders but remains fixed in size.
ANCHOR_VERTFIX 512 // Anchors center of control relative to top and bottom borders but remains fixed in size.
Aqui levamos como padrão 1024x768 na hora de fazer as telas e, na hwgui temos umas propriedades: Anchor que redimenciona a tela conforme o usuário aumenta ou diminui a tela que está.
ORing this bit values:
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)
ANCHOR_TOPABS 1 // Anchors control to top border of container and does not change the distance between the top border.
ANCHOR_LEFTABS 2 // Anchors control to left border of container and does not change the distance between the left border.
ANCHOR_BOTTOMABS 4 // Anchors control to bottom border of container and does not change the distance between the bottom border.
ANCHOR_RIGHTABS 8 // Anchors control to right border of container and does not change the distance between the right border.
ANCHOR_TOPREL 16 // Anchors control to top border of container and maintains relative distance between the top border.
ANCHOR_LEFTREL 32 // Anchors control to left border of container and maintains relative distance between the left border.
ANCHOR_BOTTOMREL 64 // Anchors control to bottom border of container and maintains relative distance between the bottom border.
ANCHOR_RIGHTREL 128 // Anchors control to right border of container and maintains relative distance between the right border.
ANCHOR_HORFIX 256 // Anchors center of control relative to left and right borders but remains fixed in size.
ANCHOR_VERTFIX 512 // Anchors center of control relative to top and bottom borders but remains fixed in size.
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
xHarbour.org + Hwgui + PostgreSql
-
samuel kalan
- Usuário Nível 1

- Mensagens: 2
- Registrado em: 16 Mar 2018 14:45
- Localização: Guarapuava-PR
Tem como definir forms sem usar pixels?
oi sr. quintas sou o mesmo samuel do gurpo minigui d facebook lembra?
entrei hoje para este fórum, nem sabia que eles existiam enfim...
se ainda for tempo, a respeito de sua pergunta:
*----------------------------------------------------------------------------
* limitar tam da janela
*----------------------------------------------------------------------------
Function TamJan()
#pragma BEGINDUMP
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
#include "hbvm.h"
#include "hbstack.h"
#include "hbapiitm.h"
HB_FUNC (GETDESKTOPREALTOP)
{
RECT rect;
int t ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
t = rect.top ;
hb_retni(t);
}
HB_FUNC (GETDESKTOPREALLEFT)
{
RECT rect;
int l ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
l = rect.left ;
hb_retni(l);
}
HB_FUNC (GETDESKTOPREALWIDTH)
{
RECT rect;
int w ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
w = rect.right - rect.left ;
hb_retni(w);
}
HB_FUNC (GETDESKTOPREALHEIGHT)
{
RECT rect;
int h ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
h = rect.bottom - rect.top ;
hb_retni(h);
}
#pragma ENDDUMP
aolique em uma função separada do seu progrma principal, isso se vc não usa ide, se uar, bom ai não confio que funcione.
abraços
entrei hoje para este fórum, nem sabia que eles existiam enfim...
se ainda for tempo, a respeito de sua pergunta:
*----------------------------------------------------------------------------
* limitar tam da janela
*----------------------------------------------------------------------------
Function TamJan()
#pragma BEGINDUMP
#define HB_OS_WIN_32_USED
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include "hbapi.h"
#include "hbvm.h"
#include "hbstack.h"
#include "hbapiitm.h"
HB_FUNC (GETDESKTOPREALTOP)
{
RECT rect;
int t ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
t = rect.top ;
hb_retni(t);
}
HB_FUNC (GETDESKTOPREALLEFT)
{
RECT rect;
int l ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
l = rect.left ;
hb_retni(l);
}
HB_FUNC (GETDESKTOPREALWIDTH)
{
RECT rect;
int w ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
w = rect.right - rect.left ;
hb_retni(w);
}
HB_FUNC (GETDESKTOPREALHEIGHT)
{
RECT rect;
int h ;
SystemParametersInfo( SPI_GETWORKAREA, 1, &rect, 0 );
h = rect.bottom - rect.top ;
hb_retni(h);
}
#pragma ENDDUMP
aolique em uma função separada do seu progrma principal, isso se vc não usa ide, se uar, bom ai não confio que funcione.
abraços
- JoséQuintas
- Administrador

- Mensagens: 20267
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
Tem como definir forms sem usar pixels?
Lembro sim.
Dica: pra código fonte, é interessante formatar com as tags pra isso.
[ code ] e [ /code ], sem os espaços
fica assim
Provavelmente vão editar seu post e acrescentar a formatação.
Dica: pra código fonte, é interessante formatar com as tags pra isso.
[ code ] e [ /code ], sem os espaços
fica assim
Código: Selecionar todos
FUNCTION Main()
RETURN NIL
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/
