October 31, 2025, 02:39:28 PM

News:

IWBasic runs in Windows 11!


Dialog with style "@HIDDEN"

Started by Ficko, July 03, 2009, 09:47:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ficko

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

Ficko

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?

Ionic Wind Support Team

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.
Ionic Wind Support Team

Ficko

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. :)

Ionic Wind Support Team

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.
Ionic Wind Support Team

Ficko

I guess my timming is bad.

Sorry for asking. :(

Ionic Wind Support Team

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.
Ionic Wind Support Team

Ficko

Thank You Paul!

I didn't know this "trick":


m_bDialog = FALSE/TRUE

:D

Now I learned something. ;)