Good ! Thanksesgici wrote:Does may be with this (shorter) way :
Code: Select all
Function ISAPPXPTHEMED() RETURN ( OS_ISWINXP_OR_LATER() .AND. IsAppThemed() )
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.By the way, did you tried for a form included radio group control ?
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