Hi
We have DEFINE WINDOW properties like ThisWindow.Handle --> nFormHandle
But how to define / create properties like ThisWindow.Name --> cFormName
DEFINE WINDOW properties
Moderator: Rathinagiri
DEFINE WINDOW properties
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: DEFINE WINDOW properties
Sorry but I do not understand.
Semi-OOP object ThisWindow.Name does exist. You can with the object ThisWindow.<Property/MethodName> use any method or property associated with the form.
Semi-OOP object ThisWindow.Name does exist. You can with the object ThisWindow.<Property/MethodName> use any method or property associated with the form.
Re: DEFINE WINDOW properties
Hi
You are correct that Semi-OOP object ThisWindow.Name does exist.
I would like to know what is the form name of opened/focused window
We can create such OOP style to get Form name easily
You are correct that Semi-OOP object ThisWindow.Name does exist.
I would like to know what is the form name of opened/focused window
We can create such OOP style to get Form name easily
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: DEFINE WINDOW properties
Do you mean something like this?:
Code: Select all
#include "hmg.ch"
#xtranslate FocusedWindow . <p:Title,NotifyIcon,NotifyTooltip,FocusedControl,Name,Row,Col,Width,Height> => GetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> )
#xtranslate FocusedWindow . <p:Title,Cursor,NotifyIcon,NotifyTooltip,Row,Col,Width,Height> := <arg> => SetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> , <arg> )
#xtranslate FocusedWindow . <p:Activate,Center,Redraw,CenterDesktop,Release,Maximize,Minimize,Restore,Show,Hide,SetFocus> [ () ] => DoMethod ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> )
#xtranslate FocusedWindow . <p:CenterIn> (\<arg\>) => DoMethod ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , \<"p"\> , \<"arg"\> )
#xtranslate FocusedWindow . <p:HANDLE,INDEX,IsMinimized,IsMaximized,ClientAreaWidth,ClientAreaHeight> => GetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> )
#xtranslate FocusedWindow . <p:NoClose,NoCaption,NoMaximize,NoMinimize,NoSize,NoSysMenu,HScroll,VScroll,Enabled> => GetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> )
#xtranslate FocusedWindow . <p:NoClose,NoCaption,NoMaximize,NoMinimize,NoSize,NoSysMenu,HScroll,VScroll,Enabled> := <arg> => SetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> , <arg> )
#xtranslate FocusedWindow . <p:AlphaBlendTransparent,BackColorTransparent> := <arg> => SetProperty ( GetFormNameByIndex( _HMG_LastActiveFormIndex ) , <"p"> , <arg> )
Function Main
DEFINE WINDOW Win_1 ;
ROW 0 ;
COL 0 ;
WIDTH 350 ;
HEIGHT 150 ;
TITLE 'Win 1' ;
WINDOWTYPE MAIN
DEFINE BUTTON B_1
ROW 10
COL 10
WIDTH 90
HEIGHT 28
CAPTION ""
ACTION Nil
END BUTTON
DEFINE STATUSBAR FONT 'Verdana' SIZE 7
STATUSITEM ""
END STATUSBAR
DEFINE TIMER Timer_1 ;
INTERVAL 100 ;
ACTION getFocusedForm()
END WINDOW
DEFINE WINDOW Win_2 ;
ROW 150 ;
COL 150 ;
WIDTH 350 ;
HEIGHT 150 ;
TITLE 'Win 2'
END WINDOW
DEFINE WINDOW Win_3 ;
ROW 300 ;
COL 300 ;
WIDTH 350 ;
HEIGHT 150 ;
TITLE 'Win 3'
END WINDOW
DEFINE WINDOW Win_4 ;
ROW 450 ;
COL 450 ;
WIDTH 350 ;
HEIGHT 150 ;
TITLE 'Win 4'
END WINDOW
Activate Window Win_1, Win_2, Win_3, Win_4
Return
***************************************************************************
Function getFocusedForm()
Win_1.StatusBar.Item(1) := "FocusedWindow.Name=" + FocusedWindow.Name + " , ThisWindow.Name=" + ThisWindow.Name
Win_1.B_1.Caption := FocusedWindow.Title
Return
Re: DEFINE WINDOW properties
Thank you Edward
Exactly what I needed
It will also useful to other user also
Exactly what I needed
It will also useful to other user also
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG