It is currently Mon Nov 18, 2019 7:52 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SplitterGadget
PostPosted: Tue Apr 16, 2019 10:43 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 500
I'm not entirely sure this is a bug, but it doesn't happen on Windows.

When you resize the leftmost splitter, the containers on the very right fire events, despite them not actually changing size. This causes a lot of slowdown in my application.
Code:
Enumeration
  #RightTopContainer
  #RightBottomContainer
  #RightSplitter
  #LeftTopContainer
  #LeftBottomContainer
  #LeftSplitter
  #Container
  #MiddleSplitter
  #MainSplitter
EndEnumeration

Global NewList containers.i()
AddElement(containers()) : containers() = #Container
AddElement(containers()) : containers() = #LeftTopContainer
AddElement(containers()) : containers() = #LeftBottomContainer
AddElement(containers()) : containers() = #RightTopContainer
AddElement(containers()) : containers() = #RightBottomContainer

Procedure OnContainerResized()
  ForEach containers()
    If EventGadget() = containers()
      SetGadgetColor(containers(), #PB_Gadget_BackColor, RGB(255, 0, 0))
    Else
      SetGadgetColor(containers(), #PB_Gadget_BackColor, RGB(0, 0, 0))
    EndIf
  Next
EndProcedure

Procedure OnWindowSized()
  ResizeGadget(#MainSplitter, 0, 0, WindowWidth(0), WindowHeight(0))
EndProcedure

OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)

BindEvent(#PB_Event_SizeWindow, @OnWindowSized(), 0)

ContainerGadget(#RightTopContainer, 0, 0, 0, 0, #PB_Container_Single) : CloseGadgetList()
ContainerGadget(#RightBottomContainer, 0, 0, 0, 0, #PB_Container_Single) : CloseGadgetList()
SplitterGadget(#RightSplitter, 0, 0, 100, 100, #RightTopContainer, #RightBottomContainer)

ContainerGadget(#LeftTopContainer, 0, 0, 0, 0, #PB_Container_Single) : CloseGadgetList()
ContainerGadget(#LeftBottomContainer, 0, 0, 0, 0, #PB_Container_Single) : CloseGadgetList()
SplitterGadget(#LeftSplitter, 0, 0, 100, 100, #LeftTopContainer, #LeftBottomContainer)

ContainerGadget(#Container, 0, 0, 100, 100, #PB_Container_Single) : CloseGadgetList()

SplitterGadget(#MiddleSplitter, 0, 0, 640, 480, #Container, #RightSplitter, #PB_Splitter_Vertical | #PB_Splitter_SecondFixed)

SplitterGadget(#MainSplitter, 0, 0, 640, 480, #LeftSplitter, #MiddleSplitter, #PB_Splitter_Vertical)

SetGadgetState(#MiddleSplitter, 100)
SetGadgetState(#LeftSplitter, 100)

BindGadgetEvent(#RightTopContainer, @OnContainerResized(), #PB_EventType_Resize)
BindGadgetEvent(#RightBottomContainer, @OnContainerResized(), #PB_EventType_Resize)
BindGadgetEvent(#LeftTopContainer, @OnContainerResized(), #PB_EventType_Resize)
BindGadgetEvent(#LeftBottomContainer, @OnContainerResized(), #PB_EventType_Resize)
BindGadgetEvent(#Container, @OnContainerResized(), #PB_EventType_Resize)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow


Top
 Profile  
Reply with quote  
 Post subject: Re: SplitterGadget
PostPosted: Tue Apr 16, 2019 2:04 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13627
Location: France
Is this a regression ?


Top
 Profile  
Reply with quote  
 Post subject: Re: SplitterGadget
PostPosted: Tue Apr 16, 2019 3:04 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 500
No, it was the same in 5.70. I just gave up on trying to solve it, haha.


Top
 Profile  
Reply with quote  
 Post subject: Re: SplitterGadget
PostPosted: Tue Apr 16, 2019 3:44 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13627
Location: France
Nice, because I changed some code in splitter so I wondered !


Top
 Profile  
Reply with quote  
 Post subject: Re: SplitterGadget
PostPosted: Sat Oct 05, 2019 10:28 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 500
Were you ever able to take a look at this, Fred? It is causing a lot of slowdown when using the splitter, which looks unprofessional. I don't think the #RightTopContainer and #RightBottomContainer gadgets should be firing events when the left-hand splitter is moved.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 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