Splitter

I really don’t understand why there isn’t a window splitter component in xojo.

A splitter component is as important as a button component so why is it only available through 3rd parties, which in almost all cases fails in perfection or is too expensive.

So xojo crew please explain me, why !!

Whats a splitter component?

A splitter component is a control that allows you to slide “subwindows” on the screen to make them wider or taller.

Usuually (but not always) denoted by 3 dots or similar type of graphic in the center, and your cursur usually changes to a double headed arrow when the mouse is over it.

There are many 3rd party implementaions of this type of control available for Xojo.

And personally at this point in time… I would rather see Xojo rescources applied to making the IDE at least as good as the RS one was… There are still even in R3 many annoying issues (like the cursor jumping to the wrong window at the wrong time)

Adding to what Dave says… The straightforward way to solve this problem is a Canvas subclass for the splitter, and containers for panels. With Xojo, the ContainerControl is now included with every license, whereas in RealStudio, it was a Professional/Enterprise feature. To get started writing your own splitter…

  1. Make it draw,
  2. In MouseDown, save the “anchor” click for x or y (if vertical or horiz splitter respectively).
  3. In MouseDrag, adjust the position of the splitter so that its anchor will match the current mouse position, subject to any constraints you impose on resizing.
  4. Also in MouseDrag, resize affected containers.

That’s all there is to a splitter control.

It is also easy to build a button with a canvas, still there are several button components available in the IDE.

But that is not the point. I just don’t understand why xojo decided not to include a crucial component as a splitter is.

Maybe this is because of the flickering issues on windows that are even worse when using a splitter in your applications ?

[quote=38774:@Andre Veelbehr]Maybe this is because of the flickering issues on windows that are even worse when using a splitter in your applications ?
[/quote]

I promise you it’s nothing that sinister. I bet you could get rid of the tracking flicker with judicious use of ContainerControl.DrawInto and a window sized tracking canvas.

The reason probably has more to do with there being a lot of ways to skin this pig, platform toolkits not doing similar things, etc. They focus on native controls for native look and feel.

In the hundreds of apps I’ve written in RB/Xojo, I think I’ve used a splitter twice. The one from Einhuger works well with no flicker.

Ahem … whether it flickers or not on Windows does not really depend on the Einhugur splitter, it rather depends on how one makes use of containers and controls (which then are moved by the splitter). I have an app which still flickers badly on Windows, and I use Einhugur splitters there.

Absolutely. I’ve spent the last 3 days building a spit screen function that doesn’t flicker on windows, without success.
I also tried all the available splitter plugins on the market, but all of them including the Einhuger flickers badly on windows.

The projects I am currently working on rely heavily on a splitscreen function, but no matter what I try I become more and more to the conclusion that Xojo isn’t the platform for this on windows.

It’s sad :frowning:

Well, try 3 listboxes horizontally and 1 vertically with their own background colours and all (live) slidable using a splitter on windows.
I am sure this isn’t possible without flickering.

In that case, you want to dump the built-in controls and go with custom canvas based replacements. Like the IDE does. It’s possible. It just isn’t easy. So, no, maybe Xojo isn’t the best solution in that case.

I’m pretty sure in Microsoft applications the split bar is moved and the controls are not updated until the mouse up event of the split bar. This will avoid the flicker. Correct me if I’m wrong.

As I mentioned above, I am talking about LIVE sliding.

Yes I realise. But everyone complains about flicker on windows but that is because they are trying to do what they do on a mac in windows. If you have a splitter in windows don’t do live resize/slide, resize on the mouse up event of the splitter.

So what’s too expensive? That seems to have been another parameter here…

I agree with that. I do not see how otherwise one would deal with more complex user interfaces, where one deals with containercontrols, pagepanels, listboxes, dynamicaly generated inputscreens distributed over several layers (panels)…

For Einhugur WindowSplitter I’m switching off its WinLiveMove property.

Plus I go as far as using Windows declares for always switching off the System setting SPI_SETDRAGFULLWINDOWS (and then back to user setting) when activating/deactivating my Windows Apps.

(For a downloadable example go to this thread)

[h]Alternative Xojo Splitter solution[/h]

A bit late (7 years) in replying to this thread, I’m afraid, but hopefully it may still be relevant for some forum members . . .

I had a great (and speedy) reply from Paul Lefebvre of Xojo on this topic, which is covered in the last ten minutes of his online video “Developing a Text Editor, part 2” (starts at around 49’:10" into the video). Thanks, Paul!

Prior to having received Paul’s reply, I did manage to design an extremely simple yet effective alternative. The alternative shown in my “Slider Test” screenshots doesn’t comply with Microsoft’s de facto standard of being a splitter physically located between the two sub-windows (“panes”) to be split, but there’s no reason why it shouldn’t be placed there.

The solution is based on a vertical Slider control being used to adjust the relative panes’ Tops and Heights (or a horizontal Slider to adjust the Lefts and Widths). This solution may not be ideal for the purists, but it has the great advantages of a). of not suffering from flicker and b). the mouse may be used on the Slider control itself, or the Up and Down keys on the keyboard may be used where precision is required, once the control has been selected by either the mouse or by tabbing through the controls. Also, IMHO, it looks, well, pretty :slight_smile:

The default slider position (first shot below) has its Value set to 50, with MaximumValue set to 100 - this ensures smoother travel of the panes than if lower numbers were to be used. For even greater precision using the keys, these values can be increased further (e.g. 500 and 1,000 respectively. At the half-way setting (default), you will see that both the upper and lower panes occupy an equal amount of the right-hand-side window real-estate.

The second shot shows the positioning of the Slider in order for the bottom pane to occupy all of the real-estate; positioning the Slider at the other end of its range would result in the top pane occupying it all.

The final shot shows the positioning of the Slider at a randomly chosen position.

I’d be happy to share the relevant (and very short) source code if requested.

See also https://forum.xojo.com/47782-create-split-window/0.

I use imSplitter which works very well.

Your images don’t show, BTW.

@Stephen Bullas
your images are on your local computer.

c:\\Users\\steph\\OneDrive\\Pictures\\Screenshots\\2020-06-17%20(1).png c:\\Users\\steph\\OneDrive\\Pictures\\Screenshots\\2020-06-17%20(2).png
That’s not going to work here.
You need to put the pictures on a (picture) server (flickr, etc).
Use the server link to a picture and use that link to make showing your picture here on the forum possible.

Björn’s WindowSplitter plugin is the best cross-platform version that I’ve used.

Einhugur WindowSplitter