Clipper On Line • Ver Tópico - Tem como definir forms sem usar pixels?

Tem como definir forms sem usar pixels?

Projeto MiniGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

 

Tem como definir forms sem usar pixels?

Mensagempor JoséQuintas » 29 Dez 2017 13:18

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?
José M. C. Quintas
Harbour 3.2, mingw, gtwvg, multithread, dbfcdx, ADO+MySql, PNotepad
"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 de usuário

JoséQuintas
Membro Master

Membro Master
 
Mensagens: 18007
Data de registro: 26 Fev 2007 11:59
Cidade/Estado: São Paulo-SP
Curtiu: 15 vezes
Mens.Curtidas: 1206 vezes

Tem como definir forms sem usar pixels?

Mensagempor MSDN » 29 Dez 2017 23:11

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.
MSDN
Usuário Nível 4

Usuário Nível 4
 
Mensagens: 741
Data de registro: 28 Nov 2003 14:55
Cidade/Estado: CWB
Curtiu: 178 vezes
Mens.Curtidas: 123 vezes

Tem como definir forms sem usar pixels?

Mensagempor sygecom » 30 Dez 2017 13:25

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.
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
leonardodemachado@hotmail.com

Faça você também sua doação esse fórum é uma lenda viva: http://www.pctoledo.com.br/doacao
Avatar de usuário

sygecom
Usuário Nível 7

Usuário Nível 7
 
Mensagens: 7005
Data de registro: 21 Jul 2006 10:12
Cidade/Estado: Alvorada-RS
Curtiu: 1 vez
Mens.Curtidas: 130 vezes

Tem como definir forms sem usar pixels?

Mensagempor samuel kalan » 16 Mar 2018 17:24

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
samuel kalan
Usuário Nível 1

Usuário Nível 1
 
Mensagens: 2
Data de registro: 16 Mar 2018 14:45
Cidade/Estado: Guarapuava-PR
Curtiu: 0 vez
Mens.Curtidas: 0 vez

Tem como definir forms sem usar pixels?

Mensagempor JoséQuintas » 16 Mar 2018 21:12

Lembro sim.

Dica: pra código fonte, é interessante formatar com as tags pra isso.
[ code ] e [ /code ], sem os espaços
fica assim

FUNCTION Main()
   RETURN NIL


Provavelmente vão editar seu post e acrescentar a formatação.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg, multithread, dbfcdx, ADO+MySql, PNotepad
"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 de usuário

JoséQuintas
Membro Master

Membro Master
 
Mensagens: 18007
Data de registro: 26 Fev 2007 11:59
Cidade/Estado: São Paulo-SP
Curtiu: 15 vezes
Mens.Curtidas: 1206 vezes




Retornar para MiniGui

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 10 visitantes


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro