How to test if StatusBar is defined in current window?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

How to test if StatusBar is defined in current window?

Post by mol »

i need to test if status bar is defined.
Do anybody know how to do it?
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: How to test if StatusBar is defined in current window?

Post by gfilatov »

mol wrote:i need to test if status bar is defined.
Do anybody know how to do it?
Hi,

Please be so kind to try the following working sample:

Code: Select all

#include "minigui.ch"

Function Main

	SET DATE GERMAN

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 640 ;
		HEIGHT 400 ;
		TITLE 'Statusbar Keyboard Demo' ;
		MAIN 

		DEFINE STATUSBAR FONT 'Arial' SIZE 9
			STATUSITEM "Statusbar Demo"
			KEYBOARD
			DATE 
			CLOCK 
		END STATUSBAR
 
	END WINDOW

msginfo( Iif(IsControldefined( Statusbar, Form_1 ), "TRUE", "FALSE") )

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return
;)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to test if StatusBar is defined in current window?

Post by mol »

I've tried to go this way earlier, but I always got information that statusbar is not defined.

So, Grigori, your sample doesn't work :-(
User avatar
gfilatov
Posts: 1116
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: How to test if StatusBar is defined in current window?

Post by gfilatov »

mol wrote:I've tried to go this way earlier, but I always got information that statusbar is not defined.

So, Grigori, your sample doesn't work :-(
Hi Marek,

Sorry but try an aboved sample :!:

It works fine with HMG 3.0 Test VI:
- modified sample demo3.prg at your folder hmg\samples\statusbar;
- compiled by command build.bat demo3
- look for message "TRUE" :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How to test if StatusBar is defined in current window?

Post by mol »

I must excuse you!
It works!
I've tried

Code: Select all

 IsControlDefined (cWindowName, "StatusBar")
but a trick relys on cWindowName - it was variable containing name of window

I've changed in my program for:

Code: Select all

 IsControlDefined (&cWindowName, StatusBar)
and it starts to work!

Many thanks, Grigori
Post Reply