Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Combining multiple windows  (Read 201 times)

0 Members and 1 Guest are viewing this topic.

mickes27

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Combining multiple windows
« on: May 29, 2019, 11:33:14 am »
Hello, I am making a program which is a physical simulation. I would like to have big lattice with atoms, next to it, on right - plots and charts and on left - sliders and buttons with options. I am wondering if I can make 3 different classes, which contains separate windows and than just combine them with single, one, big window? Or maybe there is a better solution for that?

EDIT: Just found views tutorial - is it a correct way to do that?
« Last Edit: May 29, 2019, 11:49:39 am by mickes27 »

namanjohnson101

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Combining multiple windows
« Reply #1 on: September 21, 2019, 03:56:17 pm »
hello guys,


To choose the merge option, click the arrow next to the Merge button and select the desired merge option. The files will then be merged. If there are multiple files you want to merge at once, you can select multiple files by holding down the Ctrl key and selecting each file you want to merge.


thanks and regards
9Apps Cartoon HD Vidmate
« Last Edit: September 24, 2019, 11:28:14 am by namanjohnson101 »

Hapax

  • Hero Member
  • *****
  • Posts: 2765
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Combining multiple windows
« Reply #2 on: September 21, 2019, 05:21:33 pm »
You can simply just draw the parts where you want them. You can, of course, also group together those things that go together.

Using views to separate the window into partitions would likely be better done using the views' viewports although that can be tricky to understand at first. Viewports allow you to define rectangular regions of the window of which cannot be drawn outside; things are clipped to them. Definitely useful if you need things clipping to a hard border. They can (sort of) be considered separate windows (in the way you describe) so if that's what you need, views with custom viewports are the way to go.

View tutorial:
https://www.sfml-dev.org/tutorials/2.5/graphics-view.php
Viewport part of the above tutorial:
https://www.sfml-dev.org/tutorials/2.5/graphics-view.php#defining-how-the-view-is-viewed

More in-depth tutorial about views (that help with understanding how they work and how to use them properly) on the SFML Wiki:
https://github.com/SFML/SFML/wiki/Tutorial%3A-Using-View
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter