I pretty new to GTK# and come from mostly iOS/Mac development background with Xcode. Xcode's interface builder provides auto layout, which resizes and positions the UI elements according the device's screen resolution/size and the constraints given by developer. However, I can't find such a tool with GTK#. The closest elements I was to find were HBox, VBox, Table etc. Is there an equivalent tool for auto layout in GTK#? I am using Xamarin Studio if that changes anything.
Related
I use Qt designer (as opposed to building controls via the program) to lay out my sidebar and floating dialogs. When first launching the application, the sidebar is WAY too wide and bears no resemblance to how I saved it. The user can shrink it to a reasonable width, and that is 'remembered' after closing and re-opening the application. But it doesn't create a good first impression of our application, and not all our users are savvy enough to realize that the sidebar width can be changed.
The sidebar is quite complex, with multiple forms (QStackedWidget) and each with multiple controls. Any suggestions for forcing it to come up at the minimum width with the first use? Thanks!
You should be able to achieve the wanted behavior by setting "Horizontal Stretch" property in Qt Designer, for each of the widgets in your splitter or layout, whichever you are using to layout your components. See QSizePolicy documentation for more info.
The "Horizontal Stretch" & "Vertical Stretch" properties are located in Qt Designers Property Editor, under the sizePolicy.See the image for exact location of properties
I'm new to JavaFX, but I'm used to developing/designing applications in WPF for C#, and I want my window to be maximizable due to some hefty controls and lists. Is there an equivalent to WPF's margin in JavaFX so the controls will stay put when the window's size changes?
Thanks in advance!
No, there is no exact equivalent in JavaFX 8 to WPF margin support for all nodes.
A feature request to add node margin support is currently scheduled to be implemented for Java 9.
RT-27785 Add "margin" property to node and make it styleable from CSS
For the use case you detail (having controls stay put when the window's size changes), a couple of potential solutions are:
Use an absolute positioning layout container such as an AnchorPane.
Use a GridPane which has margin support.
Tweak the padding values on your nodes.
Set spacing for hbox/vbox style controls.
Using struts as outlined in James Weaver's (somewhat dated and slightly obsolete) document on JavaFX layout.
I am developing a tool which will have some variable sized windows. I am able to achieve this using the QSplitter horizontal & vertical. Please see attached image.
Now, how to make these individual windows detachable/maximize/close? How can I add cross markers at the top-right-corner of each window so that they can be closed maximized or detached from there? Just like this link :--
http://vector.com/portal/medien/ecu_testing/tae/test_automation_editor.png
You're looking for the QDockWidget class:
The QDockWidget class provides a widget that can be docked inside a
QMainWindow or floated as a top-level window on the desktop.
QDockWidget provides the concept of dock widgets, also know as tool
palettes or utility windows. Dock windows are secondary windows placed
in the dock widget area around the central widget in a QMainWindow.
Check out this example
In 2021, there is KDQDockWidget, an apparently much better Qt docking framework with both commercial and open source licenses.
The site lists the following advantages:
It provides advanced docking that QDockWidgets doesn’t support.
The layouting engine honors min/max size constraints and some size policies.
Supports PySide2 bindings.
Clean codebase.
Supports lazy separator resize.
You can reorder tabs with the mouse.
Supports partial layout save/restore, affecting only a chosen sub-set.
Allows double clicking on title bar to maximize.
Allows double clicking on separator to distribute equally.
Shows close button on tabs.
Allows you to make a dock widget non-closable and/or non-dockable.
Provides an optional maximize button on the title bar.
FloatingWindows can be utility windows or full native.
I'm new to Flex and am porting a pure Flash/AS3 application to Flex 4.5.
In my Flex application I have been successfully using DropShadowFilter and GlowFilter to add some interactivity to my custom components on mouse events.
Now after reading more Flex docs, I've noticed that I should better use spark.primitives.RectangularDropShadow for the shadows.
But what to use instead of the GlowFilter then?
And are filters still involved in displaying shadows and glows in Flex or do I just create a shadow with
<s:RectangularDropShadow id="myShadow"
distance="20"
alpha=".25"
blurX="7"
blurY="7"
height="{myRect.height}"
width="{myRect.width}"/>
and then just call myShadow.visible=true/false depending on the mouse event?
You can use two Drop Shadows offset by 180 degrees. I don't know if two drop shadow objects are more performant than one glow.
To find out if filters are involved, click in the RectangularDropShadow tag and press F3. Then look to see.
I'm developing a presentation tool for AIR (to be used together with, or as a replacement to, PowerPoint) but I'm quite a newcomer to flex layouting.
As you can see from the image, the presenter can open various apps from the main window.
Each of these apps open up in new windows which have different visual characteristics; some use the main content area to show graphics, others bullet points. Most app windows have buttons and view stacks with embedded Flash assets (using s:SpriteVisualElement).
My questions are the following:
1a. When developing a PowerPoint-like presentation tool with Flex, which layout type (basic, vertical etc.) will provide most flexibility?
1b. How do I make sure no clipping occurs on various projector screens - which aspect ratio should I have in mind?
2a. How can I resize children sprites in the SpriteVisualElement container proportionally to the window resolution?
2b. And where do I place this resize logic - on each component (sprite) with resizeHandlers or in one resizeHandler / window?
Please use the comment thread if you want me to elaborate further. Thanks.
Since you're new to Flex, I strongly reading up on the Flex Component LifeCycle.
1a. When developing a PowerPoint-like presentation tool with
Flex, which layout type (basic,
vertical etc.) will provide most
flexibility?
The layout you choose will depend on what you want to display. I don't see layouts as "Flexible". They do their job and position their elements appropriately. I can easily envision using all types of layouts in such a complicated application, each for different purposes.
1b. How do I make sure no clipping occurs on various projector screens -
which aspect ratio should I have in
mind?
I'm not quite sure I understand what this question means, but I take it to mean you want to avoid the presence of scroll bars in your app. To do that, you'll have to develop layout code that sizes and positions your children so that they do not extend past the height and width of your available content space. In Flex 3 (Halo) architecture, this would be done by writing an updateDisplayList() method for your component. In the Flex 4 (Spark) architecture, this would probably be done by writing an updateDisplayList() method for your skin class.
2a. How can I resize children sprites in the SpriteVisualElement
container proportionally to the window
resolution?
I believe my above answer already addresses this.
2b. And where do I place this resize logic - on each component
(sprite) with resizeHandlers or in one
resizeHandler / window?
In a resize handler, I would most likely use invalidateSkinState and/or invalidateDisplayList. The resizing code would be in the skin and/or updateDisplayList.