DEFAULT ICON (for example using inputbox)

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

DEFAULT ICON (for example using inputbox)

Post by trmpluym »

I use the latest HMG build and also HMGMiniGui.

When i use for example the function inputbox it uses the default icon. There is no parameter to change the icon or disable the sysmenu (left corner).

In MiniGui i can use

SET DEFAULT ICON TO <cIconName>

The inputbox now also uses this default icon. In HMG i cannot find the 'SET DEFAULT ICON TO' option. Is there another way of changing this behavior ?
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: DEFAULT ICON (for example using inputbox)

Post by gfilatov »

trmpluym wrote:I use the latest HMG build and also HMGMiniGui.

In HMG i cannot find the 'SET DEFAULT ICON TO' option. Is there another way of changing this behavior ?
Hi,

You are right! SET DEFAULT ICON TO option is available in HMG Extended Edition only.
There is not the above feature in HMG Official. :o
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: DEFAULT ICON (for example using inputbox)

Post by bpd2000 »

gfilatov wrote: You are right! SET DEFAULT ICON TO option is available in HMG Extended Edition only.
There is not the above feature in HMG Official. :o
Dear Gfilatov
Can you give hint how to adopt said command in HMG
BPD
Convert Dream into Reality through HMG
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: DEFAULT ICON (for example using inputbox)

Post by gfilatov »

bpd2000 wrote: Can you give hint how to adopt said command in HMG
Hi,

It is a simple modification.

I've added a new public variable _HMG_DefaultIconName := Nil at Minigui initialization.

Then added the following code in the function _DefineWindow():

Code: Select all

   IF ValType ( icon ) == 'U' .AND. ValType ( _HMG_DefaultIconName ) != 'U'
      icon := _HMG_DefaultIconName
   ENDIF
...
      BrushHandle := RegisterWindow( icon, FormName, aRGB )
After that I've created this command in an include file i_window.ch:

Code: Select all

#command SET DEFAULT ICON TO <iconname> ;
   =>;
   _HMG_DefaultIconName := <iconname>
That's all 8-)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: DEFAULT ICON (for example using inputbox)

Post by bpd2000 »

gfilatov wrote:
bpd2000 wrote: Can you give hint how to adopt said command in HMG
Hi,

It is a simple modification.

I've added a new public variable _HMG_DefaultIconName := Nil at Minigui initialization.

Then added the following code in the function _DefineWindow():

Code: Select all

   IF ValType ( icon ) == 'U' .AND. ValType ( _HMG_DefaultIconName ) != 'U'
      icon := _HMG_DefaultIconName
   ENDIF
...
      BrushHandle := RegisterWindow( icon, FormName, aRGB )
After that I've created this command in an include file i_window.ch:

Code: Select all

#command SET DEFAULT ICON TO <iconname> ;
   =>;
   _HMG_DefaultIconName := <iconname>
That's all 8-)
Excellent, Thank you Mr. Gfilatov
BPD
Convert Dream into Reality through HMG
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: DEFAULT ICON (for example using inputbox)

Post by Clip2Mania »

Just for my understanding:
I've added a new public variable _HMG_DefaultIconName := Nil at Minigui initialization.
In what file is that? In your own program?
Then added the following code in the function _DefineWindow():
That's in h_windows.prg, right ?

Thanks for clarifying!
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: DEFAULT ICON (for example using inputbox)

Post by gfilatov »

Clip2Mania wrote:Just for my understanding:
I've added a new public variable _HMG_DefaultIconName := Nil at Minigui initialization.
In what file is that? In your own program?
Then added the following code in the function _DefineWindow():
That's in h_windows.prg, right ?

Thanks for clarifying!
Hi,

Thanks for your interest!

1) look at your source\h_init.prg

2) the functions _DefineWindow() and _DefineModalWindow() are placed in source\h_windows.prg

Good luck!
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Clip2Mania
Posts: 99
Joined: Fri Jun 13, 2014 7:16 am
Location: Belgium

Re: DEFAULT ICON (for example using inputbox)

Post by Clip2Mania »

Thanks very much!
Erik
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: DEFAULT ICON (for example using inputbox)

Post by srvet_claudio »

gfilatov wrote:
bpd2000 wrote: Can you give hint how to adopt said command in HMG
Hi,

It is a simple modification.

I've added a new public variable _HMG_DefaultIconName := Nil at Minigui initialization.

Then added the following code in the function _DefineWindow():

Code: Select all

   IF ValType ( icon ) == 'U' .AND. ValType ( _HMG_DefaultIconName ) != 'U'
      icon := _HMG_DefaultIconName
   ENDIF
...
      BrushHandle := RegisterWindow( icon, FormName, aRGB )
After that I've created this command in an include file i_window.ch:

Code: Select all

#command SET DEFAULT ICON TO <iconname> ;
   =>;
   _HMG_DefaultIconName := <iconname>
That's all 8-)
Done.
Many thanks Grigory !!!
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: DEFAULT ICON (for example using inputbox)

Post by trmpluym »

Wow ! In one day this feature is implemented. Thanks ! :D

Is this change part of the next release ?

Many thanks again!
Post Reply