Valdir Posted July 5, 2013 Report Share Posted July 5, 2013 Pessoal... Existe alguma função que redimensiona o tamanho da Tela ao Entrar e ao Sair do Sistema ? Explico : com a grande variedade de monitores e suas altas resoluções existentes no mercado, gostaria que ao acessar o meu Sistema, as configurações do monitor fossem ajustadas automaticamente pelo meu Sistema para um determinado tamanho e que ao sair, ele retornasse as configurações originais. Qualquer sugestão é bem vida. Obrigado e bom final de semana. Quote Link to comment Share on other sites More sharing options...
vagner Posted July 5, 2013 Report Share Posted July 5, 2013 Olá Dr Valdir /********************************************************* * Função : Funcao em C para mudar a Resolução da Tela se Menor da Necessária para trabalhar * Data : 13/03/2013 à s 12:05:26 por Vagner * Revisado em : 13/03/2013 à s 12:05:35 por Vagner * Parâmetros : * iWidthNew - Largura MÃnima Necessária * iHeightNew - Altura MÃnima Necessária**********************************************************/ #Pragma BEGINDUMP #include <Windows.h>#include <ShellApi.h>#include <Wingdi.h>#include <hbapi.h> HB_FUNC (VMUDAVIDEO){ int iWidthNew = hb_parni(1); int iHeightNew = hb_parni(2); BOOL bSaida = hb_parl(3) ; int iWidth,iHeight ; //Pega a Configuração Atual DEVMODE DeviceMode = { 0 }; EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &DeviceMode ); iWidth = DeviceMode.dmPelsWidth; iHeight = DeviceMode.dmPelsHeight; if(bSaida || iWidth < iWidthNew && iHeight < iHeightNew) { //Muda para a nova Configuração DeviceMode.dmPelsWidth = iWidthNew ; DeviceMode.dmPelsHeight = iHeightNew; ChangeDisplaySettings( &DeviceMode, 0 ); } hb_reta( 2 ); hb_storni( iWidth , -1, 1 ); hb_storni( iHeight, -1, 2 );} #pragma ENDDUMP Modo de usar : aVideoAntes := VMudaVideo(1024,768)] Antes de Sair do Sistema VMudaVideo(aVideoAntes[1],aVideoAntes[2],.T.) Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 5, 2013 Report Share Posted July 5, 2013 // Para Usar é simples : // Resolucao de video By Vagner Wirts aResolucaoAtual := VMudaVideo(1024,768) DEFINE WINDOW oWnd MDI MENU MenuPrincipal() TITLE cTitle PIXEL ; FROM 0, 0 TO Getsysmetrics(17), Getsysmetrics(16) BRUSH oBrush ; MENUINFO 0 ICON oIco BORDER SINGLE ACTIVATE WINDOW oWnd MAXIMIZED ; VALID ENCERRA( oWnd ) // Isso fará mudar para a nova configuração, lhe retornando um array, para que qndo sair do sistema retornar para a incial VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2]) // Vagner Wirts RETURN NIL /********************************************************* * Função : Funcao em C para mudar a Resolução da Tela se Menor da Necessária para trabalhar * Data : 13/03/2013 à s 12:05:26 por Vagner * Revisado em : 13/03/2013 à s 12:05:35 por Vagner * Parâmetros : * iWidthNew - Largura MÃnima Necessária * iHeightNew - Altura MÃnima Necessária **********************************************************/ #Pragma BEGINDUMP #include <Windows.h> #include <ShellApi.h> #include <Wingdi.h> #include <hbapi.h> HB_FUNC (VMUDAVIDEO) { int iWidthNew = hb_parni(1); int iHeightNew = hb_parni(2); int iWidth,iHeight ; //Pega a Configuração Atual DEVMODE DeviceMode = { 0 }; EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &DeviceMode ); iWidth = DeviceMode.dmPelsWidth; iHeight = DeviceMode.dmPelsHeight; // if(iWidth < iWidthNew || iHeight < iHeightNew) { //Desculpem eu retirei isso pois só serve para eu, senão vcs não conseguirão retorar o monitor //Muda para a nova Configuração DeviceMode.dmPelsWidth = iWidthNew ; DeviceMode.dmPelsHeight = iHeightNew; ChangeDisplaySettings( &DeviceMode, 0 ); // } hb_reta( 2 ); hb_storni( iWidth , -1, 1 ); hb_storni( iHeight, -1, 2 ); } #pragma ENDDUMP /* Para Usar é simples : aResolucaoAtual := VMudaVideo(1024,768) Isso fará mudar para a nova configuração, lhe retornando um array, para que qndo sair do sistema retornar para a incial VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2]) Abraços, Vagner Wirts */ Quote Link to comment Share on other sites More sharing options...
Valdir Posted July 5, 2013 Author Report Share Posted July 5, 2013 Estimados amigos : Vagner e João... Obrigado pelas respostas, porém aqui não funfou. Incorporei a função C no Sistema e fiz a Chamada no inÃcio e final da Active window principal... O que pode estar errado ? Obrigado. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 5, 2013 Report Share Posted July 5, 2013 Qual é o seus rWINDOWS? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted July 5, 2013 Report Share Posted July 5, 2013 // testado e aprovado em Windows 7 32 bits com FIVEWIN 13.05 e Borland C 5.82 - 05/07/2013 // Mude a Relução para uma bem grande, tem que manter 1024 x 768. // Working with MDI enviroments #include "FiveWin.ch" static oWnd //----------------------------------------------------------------------------// function Main() local oWndEdit, oBar, oIcon, oImage local cName := "FiveWin power" // Para Usar é simples : // Resolucao de video By Vagner Wirts aResolucaoAtual := VMudaVideo(1024,768) DEFINE ICON oIcon RESOURCE "test" DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE "I am the MDI Frame" ; MDI ; MENU BuildMenu() ; // COLOR "GR+*/RB" ICON oIcon SET MESSAGE OF oWnd TO "Main Window" DEFINE WINDOW oWndEdit MDICHILD OF oWnd FROM 2, 2 TO 20, 50 ; TITLE "I am a MDI Child" COLOR "W+/R" @ 4, 2 GET cName OF oWndEdit SIZE 170, 25 COLOR "BG+/B" DEFINE BUTTONBAR oBar _3D OF oWndEdit DEFINE BUTTON OF oBar SET MESSAGE OF oWndEdit TO "Child Window" ACTIVATE WINDOW oWndEdit ACTIVATE WINDOW oWnd MAXIMIZED ; VALID MsgYesNo( "Want to End ?" ) // Isso fará mudar para a nova configuração, lhe retornando um array, para que qndo sair do sistema retornar para a incial VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2]) // Vagner Wirts return nil //----------------------------------------------------------------------------// function BuildMenu() local oMenu MENU oMenu MENUITEM "&Information" MENU MENUITEM "&About..." ACTION MsgAbout( "FiveWin", "FiveTech" ) SEPARATOR MENUITEM "&End..." ACTION oWnd:End() ENDMENU MENUITEM "&Child Windows" MENU MENUITEM "&Tiled" ACTION oWnd:Tile() MENUITEM "&Cascade" ACTION oWnd:Cascade() ENDMENU ENDMENU return oMenu //----------------------------------------------------------------------------// /********************************************************* * Função : Funcao em C para mudar a Resolução da Tela se Menor da Necessária para trabalhar * Data : 13/03/2013 à s 12:05:26 por Vagner * Revisado em : 13/03/2013 à s 12:05:35 por Vagner * Parâmetros : * iWidthNew - Largura MÃnima Necessária * iHeightNew - Altura MÃnima Necessária **********************************************************/ #Pragma BEGINDUMP #include <Windows.h> #include <ShellApi.h> #include <Wingdi.h> #include <hbapi.h> HB_FUNC (VMUDAVIDEO) { int iWidthNew = hb_parni(1); int iHeightNew = hb_parni(2); int iWidth,iHeight ; //Pega a Configuração Atual DEVMODE DeviceMode = { 0 }; EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &DeviceMode ); iWidth = DeviceMode.dmPelsWidth; iHeight = DeviceMode.dmPelsHeight; // if(iWidth < iWidthNew || iHeight < iHeightNew) { //Desculpem eu retirei isso pois só serve para eu, senão vcs não conseguirão retorar o monitor //Muda para a nova Configuração DeviceMode.dmPelsWidth = iWidthNew ; DeviceMode.dmPelsHeight = iHeightNew; ChangeDisplaySettings( &DeviceMode, 0 ); // } hb_reta( 2 ); hb_storni( iWidth , -1, 1 ); hb_storni( iHeight, -1, 2 ); } #pragma ENDDUMP /* Para Usar é simples : aResolucaoAtual := VMudaVideo(1024,768) Isso fará mudar para a nova configuração, lhe retornando um array, para que qndo sair do sistema retornar para a incial VMudaVideo(aResolucaoAtual[1],aResolucaoAtual[2]) Abraços, Vagner Wirts */ Quote Link to comment Share on other sites More sharing options...
vagner Posted July 5, 2013 Report Share Posted July 5, 2013 Olá Chame no Inicio do programa, antes de abrir a window, e no final do programa depois da activate window Quote Link to comment Share on other sites More sharing options...
Valdir Posted July 6, 2013 Author Report Share Posted July 6, 2013 Amigos : João e Vagner... Kapi, matou a pau... não funfa no Win Xp... agora no 7 é Show de Bola. Vagner, obrigado por mais esta ajuda... Valeu. abração e bom final de semana. Quote Link to comment Share on other sites More sharing options...
vagner Posted July 8, 2013 Report Share Posted July 8, 2013 Olá Valdir, Desculpe mas funciona no XP sim , eu tenho rodando em XP, Vista e Win7. O que pode ser é que a resolução que vc está tentando colocar não funciona no micro por causa da placa de vÃdeo Quote Link to comment Share on other sites More sharing options...
Geraldo (gbsilva) Posted July 9, 2013 Report Share Posted July 9, 2013 Wagner, João tudo bem com os senhores. Geraldo (gbsilva) 1 Quote Link to comment Share on other sites More sharing options...
Geraldo (gbsilva) Posted July 9, 2013 Report Share Posted July 9, 2013 Desculpem teclei enter sem querer, faltou a pergunta: essa função funciona com recursos também? Grande Valdir como vai? Grato a todos. Quote Link to comment Share on other sites More sharing options...
Valdir Posted July 9, 2013 Author Report Share Posted July 9, 2013 Boas... Vagner... realmente aqui na CPU que está com o Win Xp, não funciona . Aumentei a resolução para 1440 X 900 e solicitei alteração para 1024 x 768 que é suporta pala placa de vÃdeo e monitor e não realizou a reconfiguração. Acho que é algo relativo as configurações do Win XP, uma vez que você não tem esse problema. Esta semana vou testar em alguns clientes que tem o XP e depois te retorno.... Por enquanto Brigadão. Fala ae meu amigo Geraldo... Blz ? Aqui está tudo bem, com as Graças do bom Deus, espero que o mesmo esteja ocorrendo com você e sua famÃlia. Em relação à sua dúvida, esta função é para que ao invés de remodelarmos as nossas telas para cada configuração de vÃdeos, simplesmente reconfiguramos as placas de vÃdeo para os nossos padrões. Capiche ? abração. Quote Link to comment Share on other sites More sharing options...
oribeiro Posted December 4, 2013 Report Share Posted December 4, 2013 Quando eu projetei a minha aplicação a resolução máxima de alguns monitores era 800x600 e a maioria dos monitores ainda utilizava 640x480. Hoje as minhas telas/fontes ficam muito pequenas nas altas resoluções desses monitores atuais. Ativei todos os RESIZE16 das Dialogs e deu uma melhorada, mas ainda não é o ideal. Existe alguma função que automaticamente aumente as telas ou terei que redesenhá-las uma a uma? A função do Vagner funciona muito bem somente se a resolução sugerida no sistema existir na placa de vídeo do computador. Exemplo: aResolucaoAtual := VMudaVideo( 1024, 768 ) // A placa deve aceitar essa resolução. Aguardo, obrigado. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 4, 2013 Report Share Posted December 4, 2013 Não sei se o Gilmer ainda Representa a Easy Dialog no Brasil, veja com ele. http://fivewin.com.br/index.php?/topic/728-dimens%C3%B5es-de-telas/ Ou então, você terá que criar suas dialogs, no editor de recursos(eu uso somente 800x600 e 1024 x 768) então por enquanto uso só duas dialogs para estas duas definições de tela, Se for XP, uso a de 800 x 600 senão... Bloqueio qualquer outra resolução que o usuário escolha, mantenho 1024 x 768 com o progama do Vagner e chamo a Dialog de 1024 x 768. Por enquanto. Dá um trabalho danado criar um caminhão de dialogos. abs Quote Link to comment Share on other sites More sharing options...
joaosolution Posted December 4, 2013 Report Share Posted December 4, 2013 Srs. Boa tarde Utilizo a Display.prg 3.0 do William para meus sistemas e têm funcionado bem. É necessário alguns ajustes nos fontes mas funciona. Att João Bosco Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 4, 2013 Report Share Posted December 4, 2013 Srs. Boa tarde Utilizo a Display.prg 3.0 do William para meus sistemas e têm funcionado bem. É necessário alguns ajustes nos fontes mas funciona. Att João Bosco Inclusive com RECURSOS, ou somente em @....? Quote Link to comment Share on other sites More sharing options...
joaosolution Posted December 4, 2013 Report Share Posted December 4, 2013 Sim João Eu só trabalho com recursos. Att João Bosco Quote Link to comment Share on other sites More sharing options...
oribeiro Posted December 5, 2013 Report Share Posted December 5, 2013 João, Por favor, se possível, disponibiliza o Display 3.0 para nós. Obrigado, Quote Link to comment Share on other sites More sharing options...
joaosolution Posted December 5, 2013 Report Share Posted December 5, 2013 Srs. Em anexo. Espero que o William não se incomode com esta disponibilização qualquer problema favor me informar. Att João Bosco #include "FiveWin.ch" #include "common.ch" #include "xbrowse.ch" ********************************************************************* * NOME......: DISPLAY(oWnd,nResolution) * * VERSAO....: 3.0 - Julho de 2010 * * AUTOR.....: William de Brito Adami e FiveWidi, que iniciou este projeto * no Forum Espanhol de Fivewin . * * DESCRICAO.: Funcao para exibir a tela sempre igual em qualquer * resolucao, independente da fonte ou controle utilizado. * * PARAMETROS: oWnd: Window ou Dialog a ser redimensionado * nResolution: Numero correspondente a resolucao * que se desenhou inicialmente a tela. * ********************************************************************* function display( oWnd, nResolution, lFullres ) local lAutoresize:=.t. , nWhatSize:=0, lRepaint:=.t. * atencao: nResolution identifica em que resolucao foram inicialmente * desenhadas as telas, e DEVE ter um dos seguintes valores: * * 1 = 640 X 480 * 2 = 800 X 600 * 3 = 1024 X 768 * 4 = 1152 X 864 * 5 = 1280 X 800 * 6 = 1280 X 1024 * 7 = 1600 X 1200 * 8 = 768 X 1024 * 9 = 1440 X 900 * 10 = 1280 X 768 * 11 = 1280 X 720 AutResiz( lAutoresize, nWhatSize, oWnd, nResolution, lRepaint, lFullres ) return nil /* (20/08/2009) Inicio do REdesenvolvimento da funcao. Parametros recebidos : lAutoresize: ativa / desativa redimensionamento automatico nWhatSize: permite for‡ar o redimensionamento a valores concretos; permitindo desta maneira que a aplica‡ao possa ter um valor ao qual redimensionar as telas. oWnd: Objeto/janela/dialogo/controle a ser redimensionado. nResolution: Numero que identifica que resolucao tinha a tela na qual se desenhou o objeto. lRepaint: Indicador se deve repintar o objeto uma vez redimensionado. lFullres: Indica se os textos devem ser redimensionados no tamanho maximo do resource desenhado. Esta funcao deve ser utilizada no evento ON INIT do ACTIVATE das WINDOWs e DIALOGs . Exemplo: ACTIVATE DIALOG oDlg ON INIT display(oDlg,2,.t.) //desenhada em 800 X 600 -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* */ FUNCTION AutResiz( lAutoresize, nWhatSize, oWnd, nResolution, lRepaint,lFullres ) // Resolucao da tela no momento de definir os controles. Local nOriWidth, nOriHeight // o normal seria que fosse a resolucao atual da tela (nWhatSize=0). // Se permite forcar esta resolucao mediante o valor de nWhatSize=1,2,3,4,5,6,7,.... Local nWidth, nHeight // Sao as relacoes entre a resolucao de tela e a resolucao de desenho. Local nFactorWitdh, nFactorHeight Local nContador,ofonttmp DEFAULT lRepaint := .T. nOriWidth := 0 nOriHeight := 0 nWidth := 0 nHeight := 0 nContador := 0 If ABS(nResolution) = 1 nOriWidth := 640 nOriHeight := 480 ElseIf ABS(nResolution) = 2 nOriWidth := 800 nOriHeight := 600 ElseIf ABS(nResolution) = 3 nOriWidth := 1024 nOriHeight := 768 ElseIf ABS(nResolution) = 4 nOriWidth := 1152 nOriHeight := 864 ElseIf ABS(nResolution) = 5 nOriWidth := 1280 nOriHeight := 800 ElseIf ABS(nResolution) = 6 nOriWidth := 1280 nOriHeight := 1024 ElseIf ABS(nResolution) = 7 nOriWidth := 1600 nOriHeight := 1200 ElseIf ABS(nResolution) = 8 nOriWidth := 768 nOriHeight := 1024 ElseIf ABS(nResolution) = 9 nOriWidth := 1440 nOriHeight := 900 ElseIf ABS(nResolution) = 10 nOriWidth := 1280 nOriHeight := 768 ElseIf ABS(nResolution) = 11 nOriWidth := 1280 nOriHeight := 720 Else ScrResolution( @nOriWidth, @nOriHeight ) Endif If nWhatSize = 1 nWidth := 640 nHeight := 480 ElseIf nWhatSize = 2 nWidth := 800 nHeight := 600 ElseIf nWhatSize = 3 nWidth := 1024 nHeight := 768 ElseIf nWhatSize = 4 nWidth := 1152 nHeight := 864 ElseIf nWhatSize = 5 nWidth := 1280 nHeight := 800 ElseIf nWhatSize = 6 nWidth := 1280 nHeight := 1024 ElseIf nWhatSize = 7 nWidth := 1600 nHeight := 1200 ElseIf nWhatSize = 8 nWidth := 768 nHeight := 1024 ElseIf nWhatSize = 9 nWidth := 1440 nHeight := 900 ElseIf nWhatSize = 10 nWidth := 1280 nHeight := 768 ElseIf nWhatSize = 11 nWidth := 1280 nHeight := 720 Else ScrResolution( @nWidth, @nHeight ) Endif If lAutoresize .and. nOriHeight != nHeight /* Este sera o caso habitual, ao qual se pretende redimensionar os controles na resolucao da tela na qual estao viendo. */ If nResolution > 0 nFactorWitdh := nWidth / nOriWidth nFactorHeight := nHeight / nOriHeight ElseIf nResolution < 0 nFactorWitdh := nOriWidth / nWidth nFactorHeight := nOriHeight / nHeight EndIf If lRepaint oWnd:Hide() EndIf * se aumentou a altura If nFactorHeight > 1 ***************************** * se tiver barbutton * NOVO * ***************************** if ownd:obar <> NIL ownd:obar:nwidth:=ownd:obar:nwidth* nfactorwitdh ownd:obar:nHeight:=ownd:obar:nHeight*nfactorheight ownd:obar:nbtnwidth:=ownd:obar:nbtnwidth*nfactorwitdh ownd:obar:nbtnHeight:=ownd:obar:nbtnHeight*nfactorheight for i= 1 to len(ownd:obar:acontrols) ownd:obar:acontrols[i]:Move( ownd:obar:acontrols[i]:nTop * nFactorHeight , ; ownd:obar:acontrols[i]:nLeft * nFactorWitdh, ; ownd:obar:acontrols[i]:nWidth * nFactorWitdh, ; ownd:obar:acontrols[i]:nHeight * nFactorHeight , ; .F. ) * redimensiona o BMP da BARBUTTON o:=ownd:obar:acontrols[i]:hbitmap1 if o<>0 hbmp:=ownd:obar:acontrols[i]:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) ownd:obar:acontrols[i]:hbitmap1:=o endif next ownd:obar:refresh() endif If oWnd:ClassName()$"/TIMAGE/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) Else oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) EndIf EndIf if oWnd:ClassName()$"/TFOLDER/TPAGES/" If ValType( oWnd:aDialogs ) = "A" For nContador := 1 To Len( oWnd:aDialogs ) AutResiz( lAutoresize, nWhatSize, oWnd:aDialogs[nContador], nResolution, .F.,lFullres ) EndFor EndIf Elseif oWnd:ClassName()$"/TBTNBMP/" ********************************* * redimensiona o BMP do BTNBMP o:=oWnd:hbitmap1 if o<>0 hbmp:=ownd:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) oWnd:hbitmap1:=o endif ********************************* elseif oWnd:ClassName()$"/TCOMBOBOX/TDBCOMBO/" Else If ValType( oWnd:aControls ) = "A" For nContador := 1 To Len( oWnd:aControls ) AutResiz( lAutoresize, nWhatSize, oWnd:aControls[nContador], nResolution, .F.,lFullres ) * ajuste de fontess * controle TSAY if ownd:acontrols[nContador]:classname$"/TSAY/TSAYREF/" ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) ajustalarg(ownd:acontrols[nContador],ownd,nfactorwitdh,lFullres) ELSEif ownd:acontrols[nContador]:classname$"/TGET/TSSAY/TDSAY/" ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) ELSEif ownd:acontrols[nContador]:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) endif EndFor EndIf EndIf * se diminuiu a altura If nFactorHeight < 1 ***************************** * se tiver barbutton * NOVO * ***************************** if ownd:obar <> NIL ownd:obar:nwidth:=ownd:obar:nwidth* nfactorwitdh ownd:obar:nHeight:=ownd:obar:nHeight*nfactorheight ownd:obar:nbtnwidth:=ownd:obar:nbtnwidth*nfactorwitdh ownd:obar:nbtnHeight:=ownd:obar:nbtnHeight*nfactorheight for i= 1 to len(ownd:obar:acontrols) ownd:obar:acontrols[i]:Move( ownd:obar:acontrols[i]:nTop * nFactorHeight , ; ownd:obar:acontrols[i]:nLeft * nFactorWitdh, ; ownd:obar:acontrols[i]:nWidth * nFactorWitdh, ; ownd:obar:acontrols[i]:nHeight * nFactorHeight , ; .F. ) * redimensiona o BMP da BARBUTTON o:=ownd:obar:acontrols[i]:hbitmap1 if o<>0 hbmp:=ownd:obar:acontrols[i]:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) ownd:obar:acontrols[i]:hbitmap1:=o endif next ownd:obar:refresh() endif *************************************** if oWnd:ClassName()$"/TIMAGE/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) Elseif oWnd:ClassName()$"/TBTNBMP/" oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) ********************************* * redimensiona o BMP do BTNBMP o:=oWnd:hbitmap1 if o<>0 hbmp:=ownd:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) oWnd:hbitmap1:=o endif ********************************* Else oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) endif If ValType( oWnd:aControls ) <> "A" * ajuste de fontess * controle TSAY if ownd:classname$"/TSAY/TSAYREF/" ajustaalt(ownd,nfactorheight,lFullres) ajustalarg(ownd,ownd,nfactorwitdh,lFullres) ELSEif ownd:classname$"/TGET/TSSAY/TDSAY/" ajustaalt(ownd,nfactorheight,lFullres) ajl_FLD(ownd,nFactorWitdh) ELSEif ownd:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd,nFactorHeight) ajl_FLD(ownd,nFactorWitdh) endif EndIf EndIf If lRepaint if oWnd:lCentered // *** AAA ***// oWnd:Center() // *** AAA ***// endif // *** AAA ***// oWnd:Show() EndIf *************************************** * se for resolucao igual a que desenhou *************************************** elseif lAutoresize .and. nOriHeight = nHeight if lfullres If nResolution > 0 nFactorWitdh := nWidth / nOriWidth nFactorHeight := nHeight / nOriHeight ElseIf nResolution < 0 nFactorWitdh := nOriWidth / nWidth nFactorHeight := nOriHeight / nHeight EndIf If oWnd:ClassName()$"/TFOLDER/TPAGES/" If ValType( oWnd:aDialogs ) = "A" For nContador := 1 To Len( oWnd:aDialogs ) AutResiz( lAutoresize, nWhatSize, oWnd:aDialogs[nContador], nResolution, .F.,lfullres ) EndFor EndIf elseif oWnd:ClassName()$"/TIMAGE/" //TBITMAP/TLISTBOX/TWBROWSE/TSSAY/TDSAY/TSAYREF/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) elseif oWnd:ClassName()$"/TCOMBOBOX/TDBCOMBO/" Else If ValType( oWnd:aControls ) = "A" For nContador := 1 To Len( oWnd:aControls ) AutResiz( lAutoresize, nWhatSize, oWnd:aControls[nContador], nResolution, .F.,lfullres ) * ajuste de fontes * controle TSAY if ownd:acontrols[nContador]:classname$"/TSAY/TSAYREF/" ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) ajustalarg(ownd:acontrols[nContador],ownd,nfactorwitdh,lFullres) ELSEif ownd:acontrols[nContador]:classname$"/TGET/TSSAY/TDSAY/" ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) ELSEif ownd:acontrols[nContador]:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) endif EndFor EndIf EndIf endif EndIf Return Nil FUNCTION AjustaLarg(oq,ownd,nfact,lfullres) * se nao tiver fonte atribuida, nao faz ! LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F.,; nAlturaDaFonte,; nLarguraDaFonte := oq:ofont:nwidth,; nLarguraDoControle ,; nTime := SECONDS()+3,; oFontTmp,ofont if cFontName="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nAlturaDaFonte := oq:oFont:nHeight nlarguradafonte:=nlarguradafonte*nfact nLarguraDoControle := oq:nWidth if lFullres WHILE SECONDS() < nTime // Evita congelamento da aplicação caso não seja possível recalcular a fonte nLarguraDaFonte += 1 // Nao funciona com numeros facionados DEFINE FONT oFontTmp; NAME cFontName; SIZE nLarguraDaFonte,ABS(nAlturaDaFonte) lFlagReleaseFont := .T. IF oWnd:GetWidth(oq:varget(),oFontTmp) >= nLarguraDoControle EXIT ENDIF oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp lFlagReleaseFont := .F. ENDDO IF lFlagReleaseFont RELEASE FONT oFontTmp ENDIF oq:SetFont(oFont) else DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp endif * oq:Refresh() RETURN NIL FUNCTION AjustaAlt(oq,fact,lFullres) * se nao tiver fonte , nao faz ! LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F., nAlturaDaFonte, nAlturaDoControle LOCAL nLarguraDaFonte, nTime:= SECONDS()+3, oFontTmp,ofont * se nao tiver fonte, volta sem ajustar if cfontname="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nAlturaDaFonte:=oq:ofont:nheight if lFullres * se tiver fonte , ajusta nAlturaDoControle := (oq:nHeight)-6 nLarguraDaFonte := oq:oFont:nWidth nAlturadaFonte:=nalturadafonte*fact WHILE SECONDS() < nTime // Evita congelamento da aplicação caso não seja possível recalcular a fonte nAlturaDaFonte += 0.1 // Na altura o fracionamento funcionou DEFINE FONT oFontTmp; NAME cFontName; SIZE nLarguraDaFonte,nAlturaDaFonte lFlagReleaseFont := .T. IF oFontTmp:nHeight >= nAlturaDoControle EXIT ENDIF oq:SetFont(oFontTmp) oFont := oq:ofont //oSay:GetFont() RELEASE FONT oFontTmp lFlagReleaseFont := .F. ENDDO IF lFlagReleaseFont RELEASE FONT oFontTmp ENDIF oq:SetFont(oFont) else nLarguraDaFonte := oq:oFont:nWidth nAlturadaFonte:=nalturadafonte*fact DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp endif * oq:Refresh() RETURN NIL FUNCTION ajl_FLD(oq,nf) * se nao tiver fonte , nao faz LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F., nAlturaDaFonte, nLarguraDaFonte := 0,; nLarguraDoControle ,nTime:= SECONDS()+3, oFontTmp,ofont if cfontname="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nLarguraDoControle := oq:nWidth nAlturaDaFonte := oq:oFont:nHeight nLarguraDaFonte = nLarguraDaFonte*nf DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp If oq:ClassName()$"/TXBROWSE/" for i=1 to len(oq:acols) * pega tamanho anterior X factor ov:=oq:aCols[i]:nWidth * nf * atualiza o novo tamanho da coluna oq:aCols[i]:nWidth := ov next elseif oq:classname$"/TDSAY/" oq:Refresh() elseif oq:ClassName()$"/TWBROWSE/" * atualiza a largura das colunas for i=1 to len(oq:acolsizes) oq:acolsizes[i]:=oq:acolsizes[i]*nf next endif * oq:Refresh() RETURN NIL FUNCTION aja_FLD(oq,nf) LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F., nAlturaDaFonte := 0,; nLarguraDaFonte, oFontTmp,ofont if cfontname="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nLarguraDaFonte := oq:oFont:nWidth nAlturadaFonte:=nalturadafonte*nf DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp If oq:ClassName()$"/TXBROWSE/" oq:nRowHeight := oq:nRowHeight* nf oq:nStretchcol:=STRETCHCOL_LAST elseif oq:ClassName()$"/TSBROWSE/" oq:nHeightCell:=oq:nHeightCell * nf * oq:nheightHead:=oq:nheightHead*nf * oq:nheightFoot:=oq:nheightFoot*nf endif * oq:Refresh() RETURN NIL Quote Link to comment Share on other sites More sharing options...
william Posted December 6, 2013 Report Share Posted December 6, 2013 http://www.4shared.com/rar/NIwJho3C/DISPLAY3.html Olá João , sem problemas em compartilhar . se quiser baixar com os exemplos segue o link acima. Abraço William Adami Quote Link to comment Share on other sites More sharing options...
joao Posted December 11, 2013 Report Share Posted December 11, 2013 Boa Tarde, Estou a testar sua função e dá errado , veja a tela : https://www.dropbox.com/s/l94ejv2hixp0md6/tela.jpg Um Abraço João Alpande Quote Link to comment Share on other sites More sharing options...
william Posted December 11, 2013 Report Share Posted December 11, 2013 Olá João, pelo que eu vi o que não está redimensionando é o GROUP , correto ? Você deve declarar todos os objetos da dialog para que sejam redimensionados. Está faltando o REDEFINE GROUP , veja o exemplo que vem com a display. William Quote Link to comment Share on other sites More sharing options...
joao Posted December 12, 2013 Report Share Posted December 12, 2013 Bom dia , o Group resolveu , mas verifico alguns problemas: o tamanho de letra altera, ficando o say cortado demora alguns segundos para carregar a tela queria que fica-se em tela cheia ,não aparecer a barra,é possível? Cumprimentos João Quote Link to comment Share on other sites More sharing options...
william Posted December 13, 2013 Report Share Posted December 13, 2013 olá João, no post abaixo segue uma nova versão da display que não meche nos Says e Gets originais. Também deve ficar mais rápida para abrir a tela. Faça os testes e me avise. Quanto a retirar a barra do dialog , deve ser possível sim, talvez mexendo na classe tdialog, procure nos forums sobre isso. Att. William Quote Link to comment Share on other sites More sharing options...
william Posted December 13, 2013 Report Share Posted December 13, 2013 #include "FiveWin.ch" #include "common.ch" #include "xbrowse.ch" ********************************************************************* * NOME......: DISPLAY(oWnd,nResolution) * * VERSAO....: 3.0 - Julho de 2010 * * AUTOR.....: William de Brito Adami e FiveWidi, que iniciou este projeto * no Forum Espanhol de Fivewin . * * DESCRICAO.: Funcao para exibir a tela sempre igual em qualquer * resolucao, independente da fonte ou controle utilizado. * * PARAMETROS: oWnd: Window ou Dialog a ser redimensionado * nResolution: Numero correspondente a resolucao * que se desenhou inicialmente a tela. * ********************************************************************* function display( oWnd, nResolution, lFullres ) local lAutoresize:=.t. , nWhatSize:=0, lRepaint:=.t. * atencao: nResolution identifica em que resolucao foram inicialmente * desenhadas as telas, e DEVE ter um dos seguintes valores: * * 1 = 640 X 480 * 2 = 800 X 600 * 3 = 1024 X 768 * 4 = 1152 X 864 * 5 = 1280 X 800 * 6 = 1280 X 1024 * 7 = 1600 X 1200 * 8 = 768 X 1024 * 9 = 1440 X 900 * 10 = 1280 X 768 * 11 = 1280 X 720 * 12 = 1366 X 768 AutResiz( lAutoresize, nWhatSize, oWnd, nResolution, lRepaint, lFullres ) return nil /* (20/08/2009) Inicio do REdesenvolvimento da funcao. Parametros recebidos : lAutoresize: ativa / desativa redimensionamento automatico nWhatSize: permite for‡ar o redimensionamento a valores concretos; permitindo desta maneira que a aplica‡ao possa ter um valor ao qual redimensionar as telas. oWnd: Objeto/janela/dialogo/controle a ser redimensionado. nResolution: Numero que identifica que resolucao tinha a tela na qual se desenhou o objeto. lRepaint: Indicador se deve repintar o objeto uma vez redimensionado. lFullres: Indica se os textos devem ser redimensionados no tamanho maximo do resource desenhado. Esta funcao deve ser utilizada no evento ON INIT do ACTIVATE das WINDOWs e DIALOGs . Exemplo: ACTIVATE DIALOG oDlg ON INIT display(oDlg,2,.t.) //desenhada em 800 X 600 -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* -* */ FUNCTION AutResiz( lAutoresize, nWhatSize, oWnd, nResolution, lRepaint,lFullres ) // Resolucao da tela no momento de definir os controles. Local nOriWidth, nOriHeight // o normal seria que fosse a resolucao atual da tela (nWhatSize=0). // Se permite forcar esta resolucao mediante o valor de nWhatSize=1,2,3,4,5,6,7,.... Local nWidth, nHeight // Sao as relacoes entre a resolucao de tela e a resolucao de desenho. Local nFactorWitdh, nFactorHeight Local nContador,ofonttmp DEFAULT lRepaint := .T. nOriWidth := 0 nOriHeight := 0 nWidth := 0 nHeight := 0 nContador := 0 If ABS(nResolution) = 1 nOriWidth := 640 nOriHeight := 480 ElseIf ABS(nResolution) = 2 nOriWidth := 800 nOriHeight := 600 ElseIf ABS(nResolution) = 3 nOriWidth := 1024 nOriHeight := 768 ElseIf ABS(nResolution) = 4 nOriWidth := 1152 nOriHeight := 864 ElseIf ABS(nResolution) = 5 nOriWidth := 1280 nOriHeight := 800 ElseIf ABS(nResolution) = 6 nOriWidth := 1280 nOriHeight := 1024 ElseIf ABS(nResolution) = 7 nOriWidth := 1600 nOriHeight := 1200 ElseIf ABS(nResolution) = 8 nOriWidth := 768 nOriHeight := 1024 ElseIf ABS(nResolution) = 9 nOriWidth := 1440 nOriHeight := 900 ElseIf ABS(nResolution) = 10 nOriWidth := 1280 nOriHeight := 768 ElseIf ABS(nResolution) = 11 nOriWidth := 1280 nOriHeight := 720 ElseIf ABS(nResolution) = 12 nOriWidth := 1366 nOriHeight := 768 Else ScrResolution( @nOriWidth, @nOriHeight ) Endif If nWhatSize = 1 nWidth := 640 nHeight := 480 ElseIf nWhatSize = 2 nWidth := 800 nHeight := 600 ElseIf nWhatSize = 3 nWidth := 1024 nHeight := 768 ElseIf nWhatSize = 4 nWidth := 1152 nHeight := 864 ElseIf nWhatSize = 5 nWidth := 1280 nHeight := 800 ElseIf nWhatSize = 6 nWidth := 1280 nHeight := 1024 ElseIf nWhatSize = 7 nWidth := 1600 nHeight := 1200 ElseIf nWhatSize = 8 nWidth := 768 nHeight := 1024 ElseIf nWhatSize = 9 nWidth := 1440 nHeight := 900 ElseIf nWhatSize = 10 nWidth := 1280 nHeight := 768 ElseIf nWhatSize = 11 nWidth := 1280 nHeight := 720 ElseIf nWhatSize = 12 nWidth := 1366 nHeight := 768 Else ScrResolution( @nWidth, @nHeight ) Endif If lAutoresize .and. nOriHeight != nHeight /* Este sera o caso habitual, ao qual se pretende redimensionar os controles na resolucao da tela na qual estao viendo. */ If nResolution > 0 nFactorWitdh := nWidth / nOriWidth nFactorHeight := nHeight / nOriHeight ElseIf nResolution < 0 nFactorWitdh := nOriWidth / nWidth nFactorHeight := nOriHeight / nHeight EndIf If lRepaint oWnd:Hide() EndIf * se aumentou a altura If nFactorHeight > 1 ***************************** * se tiver barbutton * NOVO * ***************************** if ownd:obar <> NIL ownd:obar:nwidth:=ownd:obar:nwidth* nfactorwitdh ownd:obar:nHeight:=ownd:obar:nHeight*nfactorheight ownd:obar:nbtnwidth:=ownd:obar:nbtnwidth*nfactorwitdh ownd:obar:nbtnHeight:=ownd:obar:nbtnHeight*nfactorheight for i= 1 to len(ownd:obar:acontrols) ownd:obar:acontrols:Move( ownd:obar:acontrols:nTop * nFactorHeight , ; ownd:obar:acontrols:nLeft * nFactorWitdh, ; ownd:obar:acontrols:nWidth * nFactorWitdh, ; ownd:obar:acontrols:nHeight * nFactorHeight , ; .F. ) * redimensiona o BMP da BARBUTTON o:=ownd:obar:acontrols:hbitmap1 if o<>0 hbmp:=ownd:obar:acontrols:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) ownd:obar:acontrols:hbitmap1:=o endif next ownd:obar:refresh() endif If oWnd:ClassName()$"/TIMAGE/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) Else oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) EndIf EndIf if oWnd:ClassName()$"/TFOLDER/TPAGES/" If ValType( oWnd:aDialogs ) = "A" For nContador := 1 To Len( oWnd:aDialogs ) AutResiz( lAutoresize, nWhatSize, oWnd:aDialogs[nContador], nResolution, .F.,lFullres ) EndFor EndIf Elseif oWnd:ClassName()$"/TBTNBMP/" ********************************* * redimensiona o BMP do BTNBMP o:=oWnd:hbitmap1 if o<>0 hbmp:=ownd:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) oWnd:hbitmap1:=o endif ********************************* elseif oWnd:ClassName()$"/TCOMBOBOX/TDBCOMBO/" Else If ValType( oWnd:aControls ) = "A" For nContador := 1 To Len( oWnd:aControls ) AutResiz( lAutoresize, nWhatSize, oWnd:aControls[nContador], nResolution, .F.,lFullres ) * ajuste de fontess * controle TSAY if ownd:acontrols[nContador]:classname$"/TSAY/TSAYREF/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) ELSEif ownd:acontrols[nContador]:classname$"/TGET/TSSAY/TDSAY/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) ELSEif ownd:acontrols[nContador]:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) endif EndFor EndIf EndIf * se diminuiu a altura If nFactorHeight < 1 ***************************** * se tiver barbutton * NOVO * ***************************** if ownd:obar <> NIL ownd:obar:nwidth:=ownd:obar:nwidth* nfactorwitdh ownd:obar:nHeight:=ownd:obar:nHeight*nfactorheight ownd:obar:nbtnwidth:=ownd:obar:nbtnwidth*nfactorwitdh ownd:obar:nbtnHeight:=ownd:obar:nbtnHeight*nfactorheight for i= 1 to len(ownd:obar:acontrols) ownd:obar:acontrols:Move( ownd:obar:acontrols:nTop * nFactorHeight , ; ownd:obar:acontrols:nLeft * nFactorWitdh, ; ownd:obar:acontrols:nWidth * nFactorWitdh, ; ownd:obar:acontrols:nHeight * nFactorHeight , ; .F. ) * redimensiona o BMP da BARBUTTON o:=ownd:obar:acontrols:hbitmap1 if o<>0 hbmp:=ownd:obar:acontrols:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) ownd:obar:acontrols:hbitmap1:=o endif next ownd:obar:refresh() endif *************************************** if oWnd:ClassName()$"/TIMAGE/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) Elseif oWnd:ClassName()$"/TBTNBMP/" oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) ********************************* * redimensiona o BMP do BTNBMP o:=oWnd:hbitmap1 if o<>0 hbmp:=ownd:hbitmap1 nbmpwidth := nbmpwidth(hbmp) nbmpheight:= nbmpheight(hbmp) larg:=nbmpwidth*nfactorwitdh alt:=nbmpheight*nfactorheight o:=resizebmp(o,larg ,alt ) oWnd:hbitmap1:=o endif ********************************* Else oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; oWnd:nWidth * nFactorWitdh, ; oWnd:nHeight * nFactorHeight , ; .F. ) endif If ValType( oWnd:aControls ) <> "A" * ajuste de fontess * controle TSAY if ownd:classname$"/TSAY/TSAYREF/" aja_FLD(ownd,nFactorHeight) ajl_FLD(ownd,nFactorWitdh) ELSEif ownd:classname$"/TGET/TSSAY/TDSAY/" aja_FLD(ownd,nFactorHeight) ajl_FLD(ownd,nFactorWitdh) ELSEif ownd:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd,nFactorHeight) ajl_FLD(ownd,nFactorWitdh) endif EndIf EndIf If lRepaint if oWnd:lCentered // *** AAA ***// oWnd:Center() // *** AAA ***// endif // *** AAA ***// oWnd:Show() EndIf *************************************** * se for resolucao igual a que desenhou *************************************** elseif lAutoresize .and. nOriHeight = nHeight if lfullres If nResolution > 0 nFactorWitdh := nWidth / nOriWidth nFactorHeight := nHeight / nOriHeight ElseIf nResolution < 0 nFactorWitdh := nOriWidth / nWidth nFactorHeight := nOriHeight / nHeight EndIf If oWnd:ClassName()$"/TFOLDER/TPAGES/" If ValType( oWnd:aDialogs ) = "A" For nContador := 1 To Len( oWnd:aDialogs ) AutResiz( lAutoresize, nWhatSize, oWnd:aDialogs[nContador], nResolution, .F.,lfullres ) EndFor EndIf elseif oWnd:ClassName()$"/TIMAGE/" //TBITMAP/TLISTBOX/TWBROWSE/TSSAY/TDSAY/TSAYREF/" ad:=getcoors(ownd:hWnd) oWnd:Move( oWnd:nTop * nFactorHeight , ; oWnd:nLeft * nFactorWitdh, ; ((ad[4]-ad[2])) * nFactorWitdh, ; ((ad[3]-ad[1])) * nFactorHeight , ; .F. ) elseif oWnd:ClassName()$"/TCOMBOBOX/TDBCOMBO/" Else If ValType( oWnd:aControls ) = "A" For nContador := 1 To Len( oWnd:aControls ) AutResiz( lAutoresize, nWhatSize, oWnd:aControls[nContador], nResolution, .F.,lfullres ) /* * ajuste de fontes * controle TSAY if ownd:acontrols[nContador]:classname$"/TSAY/TSAYREF/" * ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) * ajustalarg(ownd:acontrols[nContador],ownd,nfactorwitdh,lFullres) ELSEif ownd:acontrols[nContador]:classname$"/TGET/TSSAY/TDSAY/" * ajustaalt(ownd:acontrols[nContador],nfactorheight,lFullres) * ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) ELSEif ownd:acontrols[nContador]:classname$"/TFOLDER/TPAGES/TCOMBOBOX/TGROUP/TTREE/TCHECKBOX/TBTNBMP/TTOOLBAR/TRADIO/TDBCOMBO/TTABS/TXBROWSE/TSBROWSE/TWBROWSE/" aja_FLD(ownd:acontrols[nContador],nFactorHeight) ajl_FLD(ownd:acontrols[nContador],nFactorWitdh) endif */ EndFor EndIf EndIf endif EndIf Return Nil FUNCTION ajl_FLD(oq,nf) * se nao tiver fonte , nao faz LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F., nAlturaDaFonte, nLarguraDaFonte := 0,; nLarguraDoControle ,nTime:= SECONDS()+3, oFontTmp,ofont if cfontname="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nLarguraDoControle := oq:nWidth nAlturaDaFonte := oq:oFont:nHeight nLarguraDaFonte = nLarguraDaFonte*nf DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp If oq:ClassName()$"/TXBROWSE/" for i=1 to len(oq:acols) * pega tamanho anterior X factor ov:=oq:aCols:nWidth * nf * atualiza o novo tamanho da coluna oq:aCols:nWidth := ov next elseif oq:classname$"/TDSAY/" oq:Refresh() elseif oq:ClassName()$"/TWBROWSE/" * atualiza a largura das colunas for i=1 to len(oq:acolsizes) oq:acolsizes:=oq:acolsizes*nf next endif * oq:Refresh() RETURN NIL FUNCTION aja_FLD(oq,nf) LOCAL cFontName := iif ( oq:oFont=NIL , "NAOFAZ" ,oq:oFont:cFaceName ) LOCAL lFlagReleaseFont := .F., nAlturaDaFonte := 0,; nLarguraDaFonte, oFontTmp,ofont if cfontname="NAOFAZ" return nil endif if oq:oFont:nWidth = NIL // *** AAA ***// oq:oFont:nWidth := 0 // *** AAA ***// endif // *** AAA ***// nLarguraDaFonte := oq:oFont:nWidth nAlturadaFonte:=nalturadafonte*nf DEFINE FONT oFontTmp; NAME cFontName; SIZE abs(nLarguraDaFonte),ABS(nAlturaDaFonte) oq:SetFont(oFontTmp) oFont := oq:ofont //osay:GetFont() RELEASE FONT oFontTmp If oq:ClassName()$"/TXBROWSE/" oq:nRowHeight := oq:nRowHeight* nf oq:nStretchcol:=STRETCHCOL_LAST elseif oq:ClassName()$"/TSBROWSE/" oq:nHeightCell:=oq:nHeightCell * nf * oq:nheightHead:=oq:nheightHead*nf * oq:nheightFoot:=oq:nheightFoot*nf endif * oq:Refresh() RETURN NIL kapiaba 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.