Consulta sobre resolución de pantalla.
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Consulta sobre resolución de pantalla.
Thanks Danny
I was not tested Tool-Bar yet.
TIA
I was not tested Tool-Bar yet.
TIA
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Consulta sobre resolución de pantalla.
Any full updated version of AutoAdjust available?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Consulta sobre resolución de pantalla.
Hi Rathi
Any problem after Danny's correction ?
Regards
Any problem after Danny's correction ?
Regards
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Consulta sobre resolución de pantalla.
I need that version only Esgici. All the corrections are in bits. I want the whole code.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Consulta sobre resolución de pantalla.
I'm not sure, it's "full" or notRathinagiri wrote:Any full updated version of AutoAdjust available?
And this not updated version of original work of Miguel; adapted to MAIN.DEMO of HMG.
Regards
Viva INTERNATIONAL HMG
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Consulta sobre resolución de pantalla.
Thank you Esgici.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: Consulta sobre resolución de pantalla.
Hi Everyone,
Here's a tweak to AutoAdjust(). Backup your old code and then replaced the FOR...NEXT loop block with this:
What it does?
1. Basically it doesn't changed the height of TEXTBOX (TEXT), and BUTTON controls.
2. SLIDER and STATUSBAR width, height and font size never changed as well.
Its okay for me to change the width so that it can better fit the desktop width and height based on monitors resolution. However when the height (TEXTBOX, SLIDER, STATUSBAR and BUTTONS) changes the screen looks like it becomes magnified (technically this is correct but some users is not pleased by these kind of effect as a result of the aspect ratio computation).
You can add more exceptions by adding case statement such as (example):
Regards,
Danny
Here's a tweak to AutoAdjust(). Backup your old code and then replaced the FOR...NEXT loop block with this:
Code: Select all
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 == "RADIOGROUP"
_HMG_aControlSpacing := _HMG_SYSDATA[ 22 ]
_HMG_aControlMiscData1 := _HMG_SYSDATA[ 8 ]
_HMG_aControlSpacing [k] := _HMG_aControlSpacing [k] * IIF(_HMG_aControlMiscData1 [k], nDivw, nDivh)
CASE ControlType == "SLIDER" // do nothing
CASE ControlType == "STATUSBAR" // do nothing
CASE ControlType == "TEXT"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) * nDivh, ; // row
_GetControlCol ( ControlName, ParentForm ) * nDivw ,; // column
_GetControlWidth( ControlName, ParentForm ) * nDivw,; // with
_GetControlHeight ( ControlName, ParentForm ) ) // height
CASE ControlType == "BUTTON"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) * nDivh, ;
_GetControlCol ( ControlName, ParentForm ) * nDivw ,;
_GetControlWidth( ControlName, ParentForm ) * nDivw,;
_GetControlHeight ( ControlName, ParentForm ) ) // _GetControlHeight ( ControlName, ParentForm ) * nDivh )
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
1. Basically it doesn't changed the height of TEXTBOX (TEXT), and BUTTON controls.
2. SLIDER and STATUSBAR width, height and font size never changed as well.
Its okay for me to change the width so that it can better fit the desktop width and height based on monitors resolution. However when the height (TEXTBOX, SLIDER, STATUSBAR and BUTTONS) changes the screen looks like it becomes magnified (technically this is correct but some users is not pleased by these kind of effect as a result of the aspect ratio computation).
You can add more exceptions by adding case statement such as (example):
Code: Select all
CASE ControlType == "LABEL"
**apply your changes here
Danny
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines
- serge_girard
- Posts: 3178
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Consulta sobre resolución de pantalla.
Very nice Steed !!!
Serge
Serge
There's nothing you can do that can't be done...
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Consulta sobre resolución de pantalla.
Thank you Danny for your sharing !
This your code is more stable one.
I have added a slider row and width and seems ok as follows:I also added the new TimerPicker control and some others little changes with controls positioning in the sample demo at attached file.
This your code is more stable one.
I have added a slider row and width and seems ok as follows:
Code: Select all
Function AutoAdjust( cForm )
Local hWnd := GetFormHandle( cForm )
Local i,; // From no
k,; // Control no
ParentForm,;
ControlCount,;
ControlName,;
ControlType,;
nWidth,;
nHeight,;
lvisible := .T.,;
nDivw,;
nDivh
IF GetDesktopWidth() < GetWindowWidth ( hWnd )
nWidth := GetDesktopWidth()
ELSE
nWidth := GetWindowWidth ( hWnd )
ENDIF
IF GetDesktopHeight() < GetWindowHeight ( hWnd )
nHeight := GetDesktopHeight()
ELSE
nHeight := GetWindowHeight( hWnd )
ENDIF
IF IsWindowVisible( hWnd ) .AND. ! IsAppXPThemed()
HideWindow ( hWnd )
ELSE
lvisible := .F.
ENDIF
i := aScan ( _HMG_SYSDATA[67], hWnd )
ParentForm := _HMG_SYSDATA[66] [i]
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 := 1
nDivh := 1
ENDIF
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 == "RADIOGROUP"
_HMG_aControlSpacing := _HMG_SYSDATA[ 22 ]
_HMG_aControlMiscData1 := _HMG_SYSDATA[ 8 ]
_HMG_aControlSpacing [k] := _HMG_aControlSpacing [k] * IIF(_HMG_aControlMiscData1 [k], nDivw, nDivh)
CASE ControlType == "SLIDER" // do nothing
_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 == "TEXT"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) * nDivh, ; // row
_GetControlCol ( ControlName, ParentForm ) * nDivw ,; // column
_GetControlWidth( ControlName, ParentForm ) * nDivw,; // with
_GetControlHeight ( ControlName, ParentForm ) ) // height
CASE ControlType == "BUTTON"
_SetControlSizePos( ControlName, ParentForm,;
_GetControlRow( ControlName, ParentForm ) * nDivh, ;
_GetControlCol ( ControlName, ParentForm ) * nDivw ,;
_GetControlWidth( ControlName, ParentForm ) * nDivw,;
_GetControlHeight ( ControlName, ParentForm ) ) // _GetControlHeight ( ControlName, ParentForm ) * nDivh )
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] [i] := nWidth
_HMG_SYSDATA[91] [i] := nHeight
IF lvisible
ShowWindow ( hWnd )
ENDIF
Return Nil
- Attachments
-
- MAIN.AUTOADJUST.rar
- (23.62 KiB) Downloaded 363 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
AutoAdjust controls by window resizing
Looking for ShellAbout function present in our HMG library, came again to this topic...
I've noted some bugs and corrected already in C:\hmg.3.4.0\SAMPLES\Basics\MAIN_AUTOADJUST as follows:
Important:
I discovered a strange behaviour, when resizing works normally in XP and in Win7 AERO mode but in CLASSIC mode is not working at all (not working anything).
And I also cutted off ISAPPXPTHEMED() because the function is not working...
B.Rgds
I've noted some bugs and corrected already in C:\hmg.3.4.0\SAMPLES\Basics\MAIN_AUTOADJUST as follows:
- Fixed ShellAbout() in Demo.prg
- Optimized code in AutoAdjust.prg for RADIOGROUP,TEXT and BUTTON (it's the same treatment)
- Be included in Demo.prg new TimerPicker control
Important:
I discovered a strange behaviour, when resizing works normally in XP and in Win7 AERO mode but in CLASSIC mode is not working at all (not working anything).
And I also cutted off ISAPPXPTHEMED() because the function is not working...
B.Rgds
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein