Re: I need help with Win32lib's remove and add style
- Posted by Mario Steele <eumario at trilake.net> Apr 12, 2005
- 433 views
Judith Evans wrote: <snip> > Since there is no reply to this question, I suppost that means this can not be > done. > So my next question is how much of a problem is it for IDE users if undocked > windows > must stay in the Main Window client area? > ~judith evans Okay, sorry about not responding to ya sooner, but I was in the midst of working with SOOP, and getting migrated over to Linux. Don't worry though, I haven't completely given up on Windows. :P To much of a market out there to be rid of it completely. In any case, the solution to your problem, would be to, for example, create the Property Box, as 1 window. Then through intuitive usage of the Afore mentioned SetParent() function refrenced by our very own Al Getz, we can dyanmically set the Parent of the Property Box between the Externally created window, for usage of "Un-Docking" the window, and the Main IDE Window, which will have it. Here's a little sniplet of code, to help you on your way:
constant xSetParent = definew32Function(user32,"SetParent",{C_LONG,C_LONG},C_INT) -- Since I don't know if Derek has it declared in user32.ew constant MainPropertyBox = createEx(Window,"Property Box",IDEWin,0,0,32,32,{WS_CHILD}), -- Add any extra flags in there you want. UnDockedPropertyBox = createEx(Window,"Property Box",0,0,0,0,0,{WS_POPUP,WS_DLGFRAME}), -- This will be the window to display the Property Box when the User Undocks it. integer UnDocked UnDocked = 0 -- It starts off in the IDEWin procedure onClick_UndockProperty(integer id, integer event, sequence param) if UnDocked then void = w32Func(xSetParent,{getHandle(MainPropertyBox),getHandle(IDEWin)}) UnDocked = 0 else void = w32Func(xSetParent,{getHandle(MainPropertyBox),getHandle(UnDockedPropertyBox)}) UnDocked = 1 end if end procedure setHandler(UnDockPropertyBox,w32HClick,routine_id("onClick_UndockProperty"))
This is a rough set of code, that's not garunteed to work from the get go, might need a little fenagling to make it work, but the basic principal is the same. It's how most other programs do the Dock/Undock stuff for their GUI. I do hope this helps Judith, cause I know how many long hours you've put in on this thing, and even though I'm on the Enemy System (Atleast to Windows I am), I'm not gonna be much help in testing. Should you ever need code still though to make things work, let me know. I still have my Win32lib API Refrence in my head, it's not gonna dis-appear anytime soon. Mario Steele http://enchantedblade.trilake.net Attaining World Dominiation, one byte at a time...