Consulta sobre resolución de pantalla.

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Consulta sobre resolución de pantalla.

Post by Pablo César »

esgici wrote:Does may be with this (shorter) way :

Code: Select all

Function ISAPPXPTHEMED()
RETURN ( OS_ISWINXP_OR_LATER() .AND. IsAppThemed() )
Good ! Thanks
By the way, did you tried for a form included radio group control ?
I see now was missing RadioGroup treatment. So as you already indicated, I added both RadioGroups (Vertical & Horizontal examples) and I did implement and seems it is working now. I am not completly sure are working 100% because some partcular seems are missing in HMG. But in case something not working properly, please advise and give examples, please.

Here a new code:

Code: Select all

#include <hmg.ch>

Function Main()
Private cForm:='Principal'

MsgInfo("Ajusta a posição, largura e fonte","Informação")
   
DEFINE WINDOW  Principal AT 126,66 WIDTH 648 HEIGHT 404 ;
	TITLE 'AutoAdjust (c)2007-2010 MigSoft ' MAIN;
    ON INIT Autoaj(cForm) ;
    ON SIZE Autoaj(cForm) ;
    ON MAXIMIZE Autoaj(cForm)


    @ 320,400 BUTTON button_1 CAPTION 'Aceptar' ;
    ACTION msginfo('Button pressed') WIDTH 100 HEIGHT 28 ;
    FONT 'MS Sans Serif' SIZE 10 ;

    principal.button_1.fontcolor:={0,0,0}

    @ 320,507 BUTTON button_2 CAPTION 'Cancelar' ;
    ACTION msginfo('Button pressed') WIDTH 100 HEIGHT 28 ;
    FONT 'MS Sans Serif' SIZE 10 ;
  
    principal.button_2.fontcolor:={0,0,0}
  
    @ 18,31 FRAME frame_1 CAPTION "Datos Generales" ;
    WIDTH 576 HEIGHT 281 ;
  
    principal.frame_1.fontcolor:={0,0,0}
    principal.frame_1.fontname:='MS Sans Serif'
    principal.frame_1.fontsize:= 10
  
    @ 322,35 LABEL label_1 WIDTH 95 HEIGHT 21 ;
    VALUE 'Nombres' FONT 'MS Sans Serif' SIZE 10 ;
  
    principal.label_1.fontcolor:={0,0,0}
  
    @ 321,150 TEXTBOX text_1 HEIGHT 24 WIDTH 219 ;
    Font 'MS Sans Serif' size 10 MAXLENGTH 30 ;
  
    principal.text_1.fontcolor:={0,0,0}
    principal.text_1.backcolor:={255,255,255}
  
    @ 40,491 IMAGE image_1 PICTURE "HP_SAVE" ;
    WIDTH 100 HEIGHT 100 STRETCH  ;
  
    @ 66,309 DATEPICKER datepicker_1 WIDTH 120 ;
    FONT 'MS Sans Serif' SIZE 10 ;
  
    principal.datepicker_1.fontcolor:={0,0,0}
    principal.datepicker_1.backcolor:={255,255,255}

    DEFINE TAB tab_1 AT 40,40 WIDTH 250 HEIGHT 250 ;
		FONT 'MS Sans Serif' SIZE 10 ;

		DEFINE PAGE " Page1 "
            @ 48,24 GRID grid_1 WIDTH 200 HEIGHT 158 ;
				HEADERS {'one','two'} WIDTHS  {60,60} ;
                FONT 'MS Sans Serif' SIZE 10

                principal.grid_1.fontcolor:={0,0,0}
				principal.grid_1.AddItem( {"Row1","Row1"} )
                principal.grid_1.AddItem( {"Row2","Row2"} )
                principal.grid_1.AddItem( {"Row3","Row3"} )
                principal.grid_1.value:=1
        END PAGE

        DEFINE PAGE " Page2 "
            @ 121,29 PROGRESSBAR progressbar_1 ;
                WIDTH 191 HEIGHT 34 VALUE 25 ;

                principal.progressbar_1.fontcolor:={0,0,0}
          END PAGE
    END TAB

    @ 108,308 LISTBOX list_1 WIDTH 158 HEIGHT 99 ;
        FONT 'MS Sans Serif' SIZE 10 ;

        principal.list_1.fontcolor:={0,0,0}
        principal.list_1.backcolor:={255,255,255}
		principal.list_1.AddItem( "Item 1" )
        principal.list_1.AddItem( "Item 2" )
        principal.list_1.AddItem( "Item 3" )
        principal.list_1.value:=1

    @ 224,313 COMBOBOX combo_1 WIDTH 100 VALUE 3;
        FONT 'MS Sans Serif' SIZE 10 ;
        ITEMS {"HMG","MiniGUI","ooHG"} ;

        principal.combo_1.fontcolor:={0,0,0}
        principal.combo_1.backcolor:={255,255,255}
		
	DEFINE RADIOGROUP RadioGroup_1
        ROW    155
        COL    490
        WIDTH  100
        HEIGHT 50
        OPTIONS { 'Option 1','Option 2'}
        VALUE 1
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        SPACING 27
        BACKCOLOR Nil
        FONTCOLOR Nil
        READONLY Nil
        HORIZONTAL .F. 
    END RADIOGROUP
	
	DEFINE RADIOGROUP RadioGroup_2
        ROW    260
        COL    310
        WIDTH  160
        HEIGHT 28
        OPTIONS { 'Option 1','Option 2'}
        VALUE 1
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        SPACING 70
        BACKCOLOR Nil
        FONTCOLOR Nil
        READONLY Nil
        HORIZONTAL .T. 
    END RADIOGROUP

    @ 243,488 BUTTON picbutt_3 PICTURE 'HMG_EDIT_CANCEL';
        ACTION msginfo('Pic button pressed') WIDTH 100 HEIGHT 44

END WINDOW
CENTER WINDOW principal
Activate Window principal
Return Nil

Function ISAPPXPTHEMED()
Return ( OS_ISWINXP_OR_LATER() .AND. IsAppThemed() )

Function AutoAj()
_AutoAdjust((GetFormHandle(cForm)) )
Return Nil

Function _AutoAdjust( hWnd )
Local i, k, 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" ) //.And.;
          //Empty( GetControlContainerHandle ( ControlName, ParentForm ) )

          if ControlType == 'RADIOGROUP'
             _HMG_SYSDATA[22][k] := _HMG_SYSDATA[22][k] * nDivh
		  // _HMG_SYSDATA[22][k] := _HMG_SYSDATA[22][k] * iif(_HMG_aControlMiscData1 [k], nDivw, nDivh)
          endif

          _SetControlSizePos ( ControlName, ParentForm,;
          _GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
          _GetControlWidth ( ControlName, ParentForm ) * nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )

          if ControlType <> 'SLIDER'
	         if empty(_HMG_SYSDATA[28] [k] )
 		        _SetFontSize ( ControlName, ParentForm , 8 * nDivh )
	         else
  		        _SetFontSize ( ControlName, ParentForm , _HMG_SYSDATA[28] [k] * nDivh )
	         endif
          endif

       endif
    endif
Next k
_HMG_SYSDATA[92]  [i] := nWidth
_HMG_SYSDATA[91] [i] := nHeight

IF lvisible
   ShowWindow ( hWnd )
ENDIF
Return Nil
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
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.

Post by esgici »

Ola Pablo
Pablo César wrote: ...I see now was missing RadioGroup treatment. So as you already indicated, I added both RadioGroups (Vertical & Horizontal examples) and I did implement and seems it is working now. I am not completly sure are working 100% because some partcular seems are missing in HMG. But in case something not working properly, ...
Sorry, but adjusting radio group not implemented nor working; produce a RTE :
Date:03/20/13 Time: 03:37:04
Error BASE/1066 Argument error: conditional

Called from _AUTOADJUST(172)
Called from AUTOAJ(116)
Called from (b)MAIN(16)
Called from _PROCESSINITPROCEDURE(5198)
Called from _ACTIVATEWINDOW(4954)
Called from MAIN(106)
and nothing missing in HMG; simply change

Code: Select all

            if ControlType == 'RADIOGROUP'
               _HMG_aControlSpacing [k] := _HMG_aControlSpacing [k] * iif(_HMG_aControlMiscData1 [k], nDivw, nDivh)
            endif
IF block to :

Code: Select all

            if ControlType == 'RADIOGROUP'
               _HMG_aControlSpacing     := _HMG_SYSDATA[ 22 ]
               _HMG_aControlMiscData1   := _HMG_SYSDATA[  8 ]
               _HMG_aControlSpacing [k] := _HMG_aControlSpacing [k] * iif(_HMG_aControlMiscData1 [k], nDivw, nDivh)
            endif
TIA :D
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Consulta sobre resolución de pantalla.

Post by Pablo César »

Thank you Esgici, it has worked OK !

Now I have included some more elements, please check if is ok.

Code: Select all

#include <hmg.ch>

Function Main()
Private cForm:='Principal'

DEFINE WINDOW  Principal AT 126,66 WIDTH 648 HEIGHT 464 ;
	TITLE 'AutoAdjust (c)2007-2010 MigSoft ' MAIN;
    ON INIT Autoaj(cForm) ;
    ON SIZE Autoaj(cForm) ;
    ON MAXIMIZE Autoaj(cForm)

    @ 18,31 FRAME frame_1 CAPTION "Datos Generales" ;
		WIDTH 576 HEIGHT 321
  
		principal.frame_1.fontcolor:={0,0,0}
		principal.frame_1.fontname:='MS Sans Serif'
		principal.frame_1.fontsize:= 10
  
    @ 40,491 IMAGE image_1 PICTURE "HP_SAVE" ;
		WIDTH 100 HEIGHT 100 STRETCH
  
    @ 66,309 DATEPICKER datepicker_1 WIDTH 120 ;
		FONT 'MS Sans Serif' SIZE 10
  
		principal.datepicker_1.fontcolor:={0,0,0}
		principal.datepicker_1.backcolor:={255,255,255}

    DEFINE TAB tab_1 AT 40,40 WIDTH 250 HEIGHT 250 ;
		FONT 'MS Sans Serif' SIZE 10

		DEFINE PAGE " Page1 "
            @ 48,24 GRID grid_1 WIDTH 200 HEIGHT 158 ;
				HEADERS {'one','two'} WIDTHS  {60,60} ;
                FONT 'MS Sans Serif' SIZE 10

                principal.grid_1.fontcolor:={0,0,0}
				principal.grid_1.AddItem( {"Row1","Row1"} )
                principal.grid_1.AddItem( {"Row2","Row2"} )
                principal.grid_1.AddItem( {"Row3","Row3"} )
                principal.grid_1.value:=1
        END PAGE

        DEFINE PAGE " Page2 "
            @ 121,29 PROGRESSBAR progressbar_1 ;
                WIDTH 191 HEIGHT 34 VALUE 25

                principal.progressbar_1.fontcolor:={0,0,0}
          END PAGE
    END TAB

    @ 108,308 LISTBOX list_1 WIDTH 158 HEIGHT 99 ;
        FONT 'MS Sans Serif' SIZE 10

        principal.list_1.fontcolor:={0,0,0}
        principal.list_1.backcolor:={255,255,255}
		principal.list_1.AddItem( "Item 1" )
        principal.list_1.AddItem( "Item 2" )
        principal.list_1.AddItem( "Item 3" )
        principal.list_1.value:=1

    @ 224,313 COMBOBOX combo_1 WIDTH 100 VALUE 2;
        FONT 'MS Sans Serif' SIZE 10 ;
        ITEMS {"MiniGUI","HMG","ooHG"}

        principal.combo_1.fontcolor:={0,0,0}
        principal.combo_1.backcolor:={255,255,255}
		
	@ 243,488 BUTTON picbutt_3 PICTURE 'HMG_EDIT_CANCEL';
        ACTION msginfo('Pic button pressed') WIDTH 100 HEIGHT 44
		
	DEFINE RADIOGROUP RadioGroup_1
        ROW    155
        COL    490
        WIDTH  100
        HEIGHT 50
        OPTIONS { 'Option 1','Option 2'}
        VALUE 1
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        SPACING 27
        BACKCOLOR Nil
        FONTCOLOR Nil
        READONLY Nil
        HORIZONTAL .F. 
    END RADIOGROUP
	
	DEFINE RADIOGROUP RadioGroup_2
        ROW    260
        COL    310
        WIDTH  160
        HEIGHT 28
        OPTIONS { 'Option 1','Option 2'}
        VALUE 1
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
        SPACING 70
        BACKCOLOR Nil
        FONTCOLOR Nil
        READONLY Nil
        HORIZONTAL .T. 
    END RADIOGROUP
	
	DEFINE STATUSBAR FONT "Arial" SIZE 9
        STATUSITEM "Test of StatusBar"
        STATUSITEM "Test 2"
        STATUSITEM "Test3"
    END STATUSBAR
	
	DEFINE CHECKBOX Check_1
        ROW    300
        COL    40
        WIDTH  100
        HEIGHT 28
        CAPTION "Check_1"
        VALUE .F.
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        BACKCOLOR NIL
        FONTCOLOR NIL
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        TRANSPARENT .F.
    END CHECKBOX
	
	DEFINE SPINNER Spinner_1
        ROW    300
        COL    180
        WIDTH  120
        HEIGHT 24
        RANGEMIN 1
        RANGEMAX 10
        VALUE 0
        FONTNAME "Arial"
        FONTSIZE 9
        TOOLTIP ""
        ONCHANGE Nil
        ONGOTFOCUS Nil
        ONLOSTFOCUS Nil
        FONTBOLD .F.
        FONTITALIC .F.
        FONTUNDERLINE .F.
        FONTSTRIKEOUT .F.
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        WRAP .F.
        READONLY .F.
        INCREMENT 1
        BACKCOLOR NIL
        FONTCOLOR NIL
    END SPINNER

    DEFINE SLIDER Slider_1
        ROW    300
        COL    320
        WIDTH  120
        HEIGHT 35
        RANGEMIN 1
        RANGEMAX 10
        VALUE 0
        TOOLTIP ""
        ONCHANGE Nil
        HELPID Nil
        TABSTOP .T.
        VISIBLE .T.
        BACKCOLOR NIL
    END SLIDER
	
	@ 362,35 LABEL label_1 WIDTH 95 HEIGHT 21 ;
		VALUE 'Nombres' FONT 'MS Sans Serif' SIZE 10 
  
		principal.label_1.fontcolor:={0,0,0}
  
    @ 361,150 TEXTBOX text_1 HEIGHT 24 WIDTH 219 ;
		Font 'MS Sans Serif' size 10 MAXLENGTH 30 
  
		principal.text_1.fontcolor:={0,0,0}
		principal.text_1.backcolor:={255,255,255}
	
	@ 360,400 BUTTON button_1 CAPTION 'Aceptar' ;
		ACTION msginfo('Button pressed') WIDTH 100 HEIGHT 28 ;
		FONT 'MS Sans Serif' SIZE 10

		principal.button_1.fontcolor:={0,0,0}

    @ 360,507 BUTTON button_2 CAPTION 'Cancelar' ;
		ACTION msginfo('Button pressed') WIDTH 100 HEIGHT 28 ;
		FONT 'MS Sans Serif' SIZE 10
  
		principal.button_2.fontcolor:={0,0,0}
	
END WINDOW
CENTER WINDOW principal
Activate Window principal
Return Nil

Function ISAPPXPTHEMED()
Return ( OS_ISWINXP_OR_LATER() .AND. IsAppThemed() )

Function AutoAj()
_AutoAdjust((GetFormHandle(cForm)) )
Return Nil

Function _AutoAdjust( hWnd )
Local i, k, 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" ) //.And.;
          //Empty( GetControlContainerHandle ( ControlName, ParentForm ) )

          if ControlType == 'RADIOGROUP'
             _HMG_aControlSpacing     := _HMG_SYSDATA[ 22 ]
             _HMG_aControlMiscData1   := _HMG_SYSDATA[  8 ]
             _HMG_aControlSpacing [k] := _HMG_aControlSpacing [k] * iif(_HMG_aControlMiscData1 [k], nDivw, nDivh)
          endif
		  
		  if ControlType <> "STATUSBAR"
		     _SetControlSizePos ( ControlName, ParentForm,;
             _GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
             _GetControlWidth ( ControlName, ParentForm ) * nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
		  endif
		  
          if ControlType <> 'SLIDER'
	         if empty(_HMG_SYSDATA[28] [k] )
 		        _SetFontSize ( ControlName, ParentForm , 8 * nDivh )
	         else
  		        _SetFontSize ( ControlName, ParentForm , _HMG_SYSDATA[28] [k] * nDivh )
	         endif
          endif

       endif
    endif
Next k
_HMG_SYSDATA[92]  [i] := nWidth
_HMG_SYSDATA[91] [i] := nHeight

IF lvisible
   ShowWindow ( hWnd )
ENDIF
Return Nil
This is a new screen:
Screen64.PNG
Screen64.PNG (30.38 KiB) Viewed 5798 times
After redimensioning several times, still ocurrs an error of RTE (Desktop with white scrren, I think this is the name: RTE ?).
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
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.

Post by esgici »

Olá Pablo

I'm glad that you too continuing to searching the better like me :)

I found the problem with Status Bar : this is special control ( really this is a real control or anything else ? ) that not have "size" and "location" properties, because it has fixed size and location; so we need isolate actual size and location ( position ) changing block from status bar :

Code: Select all

            IF ControlType # 'STATUSBAR'
            _SetControlSizePos ( ControlName, ParentForm,;
               _GetControlRow ( ControlName, ParentForm ) ;
               * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
               _GetControlWidth ( ControlName, ParentForm ) * ;
               nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
            ENDIF
But auto-adjust affairs not finished yet ;)

Now I'm working apply auto-adjust feature to our famous sample MAIN.DEMO.

And now we have another problem other than RTE ( Run Time Error ) : if user use MAXIMIZE button before re-sizing form, auto-adjust doesn't work :?

TIA :D
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: Consulta sobre resolución de pantalla.

Post by Pablo César »

esgici wrote:I'm glad that you too continuing to searching the better like me :)
yes sure and it is my pleasure too. :P
I found the problem with Status Bar : this is special control ( really this is a real control or anything else ? ) that not have "size" and "location" properties, because it has fixed size and location; so we need isolate actual size and location ( position ) changing block from status bar :

Code: Select all

            IF ControlType # 'STATUSBAR'
            _SetControlSizePos ( ControlName, ParentForm,;
               _GetControlRow ( ControlName, ParentForm ) ;
               * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
               _GetControlWidth ( ControlName, ParentForm ) * ;
               nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
            ENDIF
So it is the same that I already posted ! Only differance you are using a "#" and me "<>". For size property is different for STATUSBAR, I have seem that !
Now I'm working apply auto-adjust feature to our famous sample MAIN.DEMO.
What differance is ?
And now we have another problem other than RTE ( Run Time Error ) : if user use MAXIMIZE button before re-sizing form, auto-adjust doesn't work :?
For me it is not reproducing a RTE. For it is normal, even maximizing and resizing (before, after) so in this posted example.
But auto-adjust affairs not finished yet ;)
What more is missing ??
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
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.

Post by esgici »

Olá Pablo

Found my fault !

While adding ON MAXIMIZE clause missed ON INIT :(

Added and problem solved.

This isn't interesting; without ON INIT AutoAdjust(), ON MAXIMIZE AutoAdjust() doesn't work
( If "Maximize" button of form clicked before any re-sizing) :?

Now, everything seems to be OK about AutoAdjust()

Thanks all your participation to achieve this level.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Consulta sobre resolución de pantalla.

Post by Pablo César »

Hi dear Esgici, this matter is very interesting and in the other fórum (Clipper on Line, section Minigui) you will find out another interesting way to do quite the same. A colleague brazilian one is using other technique. Please go to there to see some more.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
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.

Post by esgici »

Pablo César wrote:Hi dear Esgici, this matter is very interesting and in the other fórum (Clipper on Line, section Minigui) you will find out another interesting way to do quite the same. A colleague brazilian one is using other technique. Please go to there to see some more.
Good morning amigo !

Thanks, I'll go to see.

TIA :D
Viva INTERNATIONAL HMG :D
User avatar
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.

Post by esgici »

esgici wrote:... I'll go to see.
Looked.

Good; even impressive, shorter than original.

- Don't support Status Bar (RTE)
- Don't change font sizes ( though said "position, width and font" ;) )

TIA :D
Viva INTERNATIONAL HMG :D
User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

Re: Consulta sobre resolución de pantalla.

Post by dhaine_adp »

Hi,

Using AutoAdjust on my app I've got the error trace below:

Date:03/29/2013 Time: 21:30:04
Error BASE/1083 Argument error: *


Called from _AUTOADJUST(581)
Called from WINDOWAUTOADJUST(518)
Called from (b)MAIN(189)
Called from _DOWINDOWEVENTPROCEDURE(5301)
Called from EVENTS(1341)
Called from RESTORE(0)
Called from _RESTOREWINDOW(3409)
Called from DOMETHOD(7395)
Called from (b)MAIN(308)
Called from _DOWINDOWEVENTPROCEDURE(5301)
Called from EVENTS(2933)
Called from SENDMESSAGE(0)
Called from _RELEASEWINDOW(3302)
Called from DOMETHOD(7383)
Called from SPLASHDELAY(327)
Called from (b)MAIN(308)
Called from _PROCESSINITPROCEDURE(5090)
Called from _ACTIVATEWINDOW(4846)
Called from MAIN(312)

To correct the problem I change this portion:

Original:

Code: Select all

        if ControlType <> "STATUSBAR"
           _SetControlSizePos ( ControlName, ParentForm,;
             _GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
             _GetControlWidth ( ControlName, ParentForm ) * nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
        endif
Into:

Code: Select all

            if !ControlType $ "STATUSBAR,TOOLBUTTON"
               _SetControlSizePos ( ControlName, ParentForm,;
               _GetControlRow ( ControlName, ParentForm ) * nDivh, _GetControlCol ( ControlName, ParentForm ) * nDivw,;
               _GetControlWidth ( ControlName, ParentForm ) * nDivw, _GetControlHeight ( ControlName, ParentForm ) * nDivh )
            endif
I hope that helps someone who's still struggling. The problem came from TOOLBAR and maybe there are more to be added on exception.

Regards,

Danny
Regards,

Danny
Manila, Philippines
Post Reply