It is currently Sun May 26, 2013 3:56 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sat Feb 18, 2012 5:33 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 710
Location: Germany
After moving one of the splittergadgets, the mdi window isnt visible anymore...

Code:
If OpenWindow(0, 0, 0, 800, 600, "MDI Window Bug", #WS_OVERLAPPEDWINDOW )
  left = ContainerGadget(#PB_Any, 0, 0, 200, 600, #PB_Container_Flat )
  CloseGadgetList()
  SetGadgetColor(left, #PB_Gadget_BackColor, #Red )
  right = ContainerGadget(#PB_Any, 200, 0, 600, 600, #PB_Container_Flat )
 
    right_sub_up = ContainerGadget(#PB_Any, 0, 0, 600, 100, #PB_Container_Flat )
    CloseGadgetList()
    SetGadgetColor(right_sub_up, #PB_Gadget_BackColor, #Blue )

    right_sub_dn = ContainerGadget(#PB_Any, 0, 100, 600, 500, #PB_Container_Flat )
      right_sub_left = ContainerGadget(#PB_Any, 0, 0, 300, 500, #PB_Container_Flat )
       
      CloseGadgetList()
      SetGadgetColor(right_sub_left, #PB_Gadget_BackColor, #Green )
      right_sub_right = ContainerGadget(#PB_Any, 300, 0, 300, 500, #PB_Container_Flat )
        mdi = MDIGadget( #PB_Any, 0, 0, 300, 500, 0, 0, #PB_MDI_BorderLess|#PB_MDI_NoScrollBars )
        AddGadgetItem(mdi, 1, "MDI Win", 0, #WS_POPUP )
        ListIconGadget(#PB_Any, 0, 0, WindowWidth(1), WindowHeight(1), "Nr", 100, #PB_ListIcon_GridLines )
        UseGadgetList( WindowID(0))
      CloseGadgetList()
      SetGadgetColor(right_sub_right, #PB_Gadget_BackColor, #Yellow )
      sp3 = SplitterGadget( #PB_Any, 0, 0, 600, 500, right_sub_left, right_sub_right, #PB_Splitter_Vertical|#PB_Splitter_Separator )
      SetGadgetState(sp3, 400)
    CloseGadgetList()
   
    sp2 = SplitterGadget( #PB_Any, 0, 0, 600, 600, right_sub_up, right_sub_dn, #PB_Splitter_Separator )
    SetGadgetState(sp2, 150)
   
  CloseGadgetList()
 
  sp1 = SplitterGadget(#PB_Any, 0, 0, 800, 600, left, right, #PB_Splitter_Vertical |#PB_Splitter_Separator )
  SetGadgetState(sp1, 200)
 
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
 Post subject: Re: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sat Feb 18, 2012 5:56 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
http://www.purebasic.com/documentation/gadget/mdigadget.html wrote:
You can only put this gadget directly on a window, you can NOT put it inside a ContainerGadget(), SplitterGadget() or PanelGadget().

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sat Feb 18, 2012 6:45 pm 
Offline
Addict
Addict

Joined: Sun Apr 12, 2009 6:27 am
Posts: 1476
It is a matter of redraw issue in your case

Code:
If OpenWindow(0, 0, 0, 800, 600, "MDI Window Bug", #WS_OVERLAPPEDWINDOW )
  left = ContainerGadget(#PB_Any, 0, 0, 200, 600, #PB_Container_Flat )
  CloseGadgetList()
  SetGadgetColor(left, #PB_Gadget_BackColor, #Red )
  right = ContainerGadget(#PB_Any, 200, 0, 600, 600, #PB_Container_Flat )
 
    right_sub_up = ContainerGadget(#PB_Any, 0, 0, 600, 100, #PB_Container_Flat )
    CloseGadgetList()
    SetGadgetColor(right_sub_up, #PB_Gadget_BackColor, #Blue )

    right_sub_dn = ContainerGadget(#PB_Any, 0, 100, 600, 500, #PB_Container_Flat )
      right_sub_left = ContainerGadget(#PB_Any, 0, 0, 300, 500, #PB_Container_Flat )
       
      CloseGadgetList()
      SetGadgetColor(right_sub_left, #PB_Gadget_BackColor, #Green )
      right_sub_right = ContainerGadget(#PB_Any, 300, 0, 300, 500, #PB_Container_Flat )
        mdi = MDIGadget( #PB_Any, 0, 0, 300, 500, 0, 0, #PB_MDI_BorderLess|#PB_MDI_NoScrollBars )
        AddGadgetItem(mdi, 1, "MDI Win", 0, #WS_POPUP )
        ListIconGadget(#PB_Any, 0, 0, WindowWidth(1), WindowHeight(1), "Nr", 100, #PB_ListIcon_GridLines )
        UseGadgetList( WindowID(0))
      CloseGadgetList()
      SetGadgetColor(right_sub_right, #PB_Gadget_BackColor, #Yellow )
      sp3 = SplitterGadget( #PB_Any, 0, 0, 600, 500, right_sub_left, right_sub_right, #PB_Splitter_Vertical|#PB_Splitter_Separator )
      SetGadgetState(sp3, 400)
    CloseGadgetList()
   
    sp2 = SplitterGadget( #PB_Any, 0, 0, 600, 600, right_sub_up, right_sub_dn, #PB_Splitter_Separator )
    SetGadgetState(sp2, 150)
   
  CloseGadgetList()
 
  sp1 = SplitterGadget(#PB_Any, 0, 0, 800, 600, left, right, #PB_Splitter_Vertical |#PB_Splitter_Separator )
  SetGadgetState(sp1, 200)

Repeat
  Select WaitWindowEvent()
     
       Case #PB_Event_CloseWindow
          Quit = 1
       
       Case #WM_CLOSE
     
      Case #PB_Event_Gadget
          Select EventGadget()
           Case sp1,sp2,sp3
              RedrawWindow_(GadgetID(mdi),#Null,#Null,#RDW_INVALIDATE|#RDW_UPDATENOW)     
          EndSelect
  EndSelect
Until Quit = 1
EndIf


_________________
Egypt my love


Top
 Profile  
 
 Post subject: Re: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sun Feb 19, 2012 8:56 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 710
Location: Germany
Thx RASHAD! Before I posted, I had also tried to use RedrawWindow_(). But it tried
it on the MDI Window itself not on the MDI Gadet...

Now it seems to be working as expected. But what about the reference in the help,
that you can not create an MDIGadget() inside a container?

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
 Post subject: Re: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sun Feb 19, 2012 9:09 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
dige wrote:
But what about the reference in the help,
that you can not create an MDIGadget() inside a container?

Is not supported and works not okay. It is not only the redraw, for
example the MDIChild can't create the closebutton in menu, if maximized.

Greetings - Thomas

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: PB4.60B1x86 Win7 x64 MDI Window disappears
PostPosted: Sun Feb 19, 2012 9:45 am 
Offline
Addict
Addict

Joined: Sun Apr 12, 2009 6:27 am
Posts: 1476
Hi dige
What ts-soft mentioned is 100% true
What we are doing is workaround for your case and always we will find our narrow escape
Keep going


Edit : Remove #WS_POPUP to show the close button for MDI Child

_________________
Egypt my love


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye