hello to everyone
I tried and tried to profane retouching program AutoAdjust to expose data also changing desktop settings were able to achieve a small result which you can test yourself and surely as the genes which I hope you are able to develop optimally
Thank you for existing
P.S. sorry but I have not found another way to insert the source file !!???
/*
* HMG - Harbour Win32 GUI library
* Copyright 2002-2008 Roberto Lopez <
mail.box.hmg@gmail.com>
*
/
*
* Revision: October 31, 2014
* Revised by: Danny Del Pilar
* HMG Sample: Managing Dynamic Windows Sample
*
*
*/
#include "hmg.ch"
***************
Function Main()
*ALTD()
*ggw - ggh cordinate del destop di costruzione
ggw= 1200
ggh= 600
PRIVATE hWndName := ""
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH ggw;
HEIGHT ggh ;
MAIN;
ON INIT AutoAdjust( ThisWindow.Name );
ON MAXIMIZE AutoAdjust( ThisWindow.Name );
ON SIZE AutoAdjust( ThisWindow.Name );
TITLE 'Button Test'
DEFINE MAIN MENU
POPUP 'Test'
ITEM 'Disable button' ACTION Form_1.Button_1.Enabled := .f.
ITEM 'Enable button' ACTION Form_1.Button_1.Enabled := .t.
SEPARATOR
* ITEM "Window 1" ACTION WIND( "window1" )
* ITEM "Window 2" ACTION WIND( "window2" )
* ITEM "Window 3" ACTION WIND( "window3" )
END POPUP
END MENU
@ 70,70 BUTTON Button_1 PICTURE "button.bmp" WIDTH 50 HEIGHT 50
@ 40,400 LABEL M1 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 200 HEIGHT 20
@ 80,400 LABEL m2 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 250 HEIGHT 20
@ 120,400 LABEL m3 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 300 HEIGHT 20
@ 140,960 LABEL m4 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 180 HEIGHT 20
@ 180,970 LABEL m5 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 180 HEIGHT 20
@ 220,980 LABEL m6 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 180 HEIGHT 20
@ 250,990 LABEL m7 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 180 HEIGHT 20
@ 280,1000 LABEL m8 VALUE 'aaaaaaaaaa' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 180 HEIGHT 20
@ 310,400 LABEL settore VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {56,240,32 } FONTCOLOR RED WIDTH 400 HEIGHT 50
@ 300,580 LABEL m9 VALUE 'turoituioer' font '.vntime' size 10 bold BACKCOLOR {156,2,132 } FONTCOLOR RED WIDTH 400 HEIGHT 20
END WINDOW
Form_1.Maximize
ACTIVATE WINDOW Form_1
Return
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Function AutoAdjust( cForm )
Local hWnd := GetFormHandle( cForm )
Local i,; // From no
k,; // Control no
ParentForm,;
ControlCount,;
ControlName,;
ControlType,;
nWidth,;
nHeight,;
lvisible := .T.,;
nDivw,;
nDivh
Private nMainW:=GetWindowWidth ( hWnd ), nMainH:=GetWindowHeight ( hWnd)
aa=ggw/GetWindowWidth ( hWnd )
bb=ggh/GetWindowHeight ( hWnd )
IF GetDesktopWidth() > GetWindowWidth ( hWnd )
nWidth :=GetDesktopWidth()
nWidth=(nWidth/nMainW)
ELSE
nWidth := GetWindowWidth ( hWnd )
nWidth=(nWidth/nMainW)
ENDIF
IF GetDesktopHeight() > GetWindowHeight ( hWnd )
nHeight := GetDesktopHeight()
nHeight=( nHeight/nMainH)
ELSE
nHeight := GetDesktopHeight()
nHeight=( nHeight/nMainH)
ENDIF
IF IsWindowVisible( hWnd ) .AND. ! IsAppXPThemed()
HideWindow ( hWnd )
ELSE
lvisible := .F.
ENDIF
i := aScan ( _HMG_SYSDATA[67], hWnd )
ParentForm := _HMG_SYSDATA[66]
IF _HMG_SYSDATA[ 92, i ] > 0 .AND. _HMG_SYSDATA[ 91, i ] >0
nDivw := nWidth / _HMG_SYSDATA[ 92, i]
nDivh := nHeight/ _HMG_SYSDATA[ 91, i]
ELSE
nDivw := aa //
nDivh := bb //
ENDIF
form_1.m1.value:=str(nMainW)
form_1.m2.value:=str(nMainH)
form_1.m3.value:=str(nWidth)
form_1.m4.value:=str(nHeight)
form_1.m5.value:=str(nDivw)+'ndivw'
form_1.m6.value:=str(nDivh)+'ndivh'
form_1.m7.value:=str(_HMG_SYSDATA[ 92, i ])
form_1.m8.value:=str(_HMG_SYSDATA[ 91, i ])
*form_1.settore.value:=str(nMainW)+str(nMainH)+str(nWidth)+str(nHeight)
ControlCount := LEN ( _HMG_SYSDATA[ 3 ] )
FOR k := 1 To ControlCount
ControlName := _HMG_SYSDATA[ 2, k ]
IF _IsControlDefined ( ControlName, ParentForm )
ControlType := _HMG_SYSDATA[ 1, k ]
IF !EMPTY( ControlName ) .AND. !( ControlType $ "MENU,HOTKEY,TOOLBAR,MESSAGEBAR,ITEMMESSAGE,TIMER" )
DO CASE
CASE ControlType == "LABEL"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) / nDivh, ; // row
_GetControlCol ( ControlName, ParentForm ) / nDivw ,; // column
_GetControlWidth( ControlName, ParentForm ) / nDivw ,; // with
_GetControlHeight ( ControlName, ParentForm)/ nDivh ) // height
form_1.settore.value:=str(_GetControlRow( ControlName, ParentForm ) )+str(ndivh)
CASE ControlType $ "RADIOGROUP,TEXT,BUTTON"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) / nDivh, ; // row
_GetControlCol ( ControlName, ParentForm ) / nDivw ,; // column
_GetControlWidth( ControlName, ParentForm ) / nDivw,; // with
_GetControlHeight ( ControlName, ParentForm ) / nDivh) // height
CASE ControlType == "SLIDER"
_SetControlSizePos ( ControlName, ParentForm,;
_GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
_GetControlWidth ( ControlName, ParentForm ) * nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
CASE ControlType == "STATUSBAR"
// do nothing
CASE !ControlType $ "TOOLBUTTON"
_SetControlSizePos ( ControlName, ParentForm,;
_GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
_GetControlWidth ( ControlName, ParentForm )* nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
OTHERWISE
IF EMPTY( _HMG_SYSDATA[ 28, k ] )
_SetFontSize ( ControlName, ParentForm , 8 * nDivh )
ELSE
_SetFontSize ( ControlName, ParentForm , _HMG_SYSDATA[28] [k] * nDivh )
ENDIF
ENDCASE
ENDIF
ENDIF
NEXT k
_HMG_SYSDATA[92] :=nWidth
_HMG_SYSDATA[91] :=nHeight
IF lvisible
ShowWindow ( hWnd )
ENDIF
Return Nil
FUNCTION ISAPPXPTHEMED()
RETURN ( OS_ISWINXP_OR_LATER() ; // <= hrb\contrib/hbwin/legacycv.c
.AND. IsAppThemed() ) // <= HMG\h_window.prg