IonicWind Software

IWBasic => General Questions => Topic started by: Ficko on July 03, 2009, 09:47:41 AM

Title: Dialog with style "@HIDDEN"
Post by: Ficko on July 03, 2009, 09:47:41 AM
I did notice a little change in "createdialog.eba" -compare to the "allsources iso" previously"-


.
.
if(style & @HIDDEN) <> @HIDDEN then _
style = style | WS_VISIBLE
style = (style & NOT(@HIDDEN))
win.#<IBDLGTEMPLATE>m_pDlgTemplate.style = DS_MODALFRAME | WS_POPUP | DS_SETFONT | style
.
.


This looks to me being a "handling" for dialoges created with style "@HIDDEN".

My question is why somebody would create a dialog with this style?
You can't see a dialog until you "show" it anyway and "@HIDDEN" won't influence "domodal" or "showdialog".

What I am missing there? :o
Title: Re: Dialog with style "@HIDDEN"
Post by: Ionic Wind Support Team on July 03, 2009, 09:58:45 AM
For ShowDialog dialogs.  When you want to manipulate their size dynamically after they are created, but before the user sees it.  And it will influence it, as the style from the template is used by both commands, which is created by the CreateTemplate function.

ShowDialog d1
'add other controls dynamically here
'adjust the size of the dialog
ShowWindow d1,@SWSHOW

All it does is remove or add WS_VISIBLE, a standard windows style.  Which gives you the same option you would have if you were using the API directly ;)

Paul.
Title: Re: Dialog with style "@HIDDEN"
Post by: Ficko on July 03, 2009, 10:27:27 AM
Thanks Paul for the reply. :)

I would lie to say 100% understand it.

Quote
And it will influence it, as the style from the template is used by both commands, which is created by the CreateTemplate function.

Yes I can see that but "SHOWDIALOG" uses:

ShowWindowA(win.hwnd,5) ;SW_SHOW

that kind of overwrites the template. :o

I just not able to come up with a piece of code that shows a difference between the two. -@HIDDE won't @HIDDE-

Should I look for some "flickering" or something, which get remedied?
Title: Re: Dialog with style "@HIDDEN"
Post by: Ionic Wind Support Team on July 03, 2009, 11:38:09 AM
Are you having some sort of difficulty with your own code that you need help with?   Is the style causing you a problem somewhere?

Otherwise it works as I intended it to ;)

Paul.
Title: Re: Dialog with style "@HIDDEN"
Post by: Ficko on July 03, 2009, 12:30:37 PM
I just trying to materialize the pseudo code you have given me above but I think I am missing some knowledge regarding: :(

Quote
'add other controls dynamically here

First I thought you meant something like that:

CREATEDIALOG d1,0,0,300,202,@CAPTION|@SYSMENU|@HIDDEN,0,"Caption",&d1_handler
CONTROL d1,@BUTTON,"Button",108,10,70,20,0x50000000,BUTTON_1
SHOWDIALOG d1
CONTROL d1,@BUTTON,"Button",308,10,70,20,0x50000000,BUTTON_2
SETSIZE d1,0,0,600,202
ShowWindow d1,@SWSHOW
WAITUNTIL RUN = 1

But this would be adding "statically" a control to a template obviouselly won't work.
"SETSIZE" works but it do work without the "HIDDEN" style.

Basically I don't understand "adding a control dynamically", I guess. ::)
Just need a working sample to chill my mind. :)
Title: Re: Dialog with style "@HIDDEN"
Post by: Ionic Wind Support Team on July 03, 2009, 12:52:17 PM
It was common in the last contract I worked on for the guy to create a blank dialog, temporarily set win.m_bDialog to FALSE, and add the controls.  Not that I recommended it, but he liked to do it that way.

Listen, I am quite busy right now, stuck in audio code with 38 source files open.  If you feel there is a bug here then file a bug report in the appropriate place and if I ever get mod portamento slides working the way I want I'll give it a look.

Paul.
Title: Re: Dialog with style "@HIDDEN"
Post by: Ficko on July 03, 2009, 01:07:41 PM
I guess my timming is bad.

Sorry for asking. :(
Title: Re: Dialog with style "@HIDDEN"
Post by: Ionic Wind Support Team on July 03, 2009, 03:03:02 PM
bad, yes, because I was struggling with an FPU bug that was driving me nuts.

As I mentioned if you set m_bDialog to false you can dynamically create controls in a dialog:

CREATEDIALOG d1,0,0,300,202,@CAPTION|@SYSMENU|@HIDDEN,0,"Caption",&d1_handler
CONTROL d1,@BUTTON,"Button",108,10,70,20,0x50000000,BUTTON_1
SHOWDIALOG d1
d1.m_bDialog = FALSE
CONTROL d1,@BUTTON,"Button",308,10,70,20,0x50000000,BUTTON_2
d1.m_bDialog = TRUE
SETSIZE d1,0,0,600,202
ShowWindow d1,@SWSHOW
WAITUNTIL RUN = 1

As whether @hidden does what it is supposed to do I'll have to check later.

Paul.
Title: Re: Dialog with style "@HIDDEN"
Post by: Ficko on July 04, 2009, 08:15:18 AM
Thank You Paul!

I didn't know this "trick":


m_bDialog = FALSE/TRUE

:D

Now I learned something. ;)