How to remove wrapped line from Combobox option. - RapidClipseX/Vaadin 14 - vaadin14

I am Using RapidclipseX and Vaadin 14, I want to know how to make this Combobox option not wrapped?
Thanks in advance.

An obvious answer is to set the width of the ComboBox to be wider, e.g. comboBox.setWidth("200px").
https://www.w3schools.com/cssref/css3_pr_word-wrap.asp
Teaches us that there is no other option really then be wide enough to accommodate the entire string.
Assuming that you want a drop-down that's wider than the box: you are using Vaadin 14, so it's important it's not in legacy (10-13) mode so that the new style of CSS is being used.
#CssImport(value = "./styles/vaadin-combo-box.css", themeFor = "vaadin-combo-box")
would allow you to style the ComboBox.
But, if you look [here]
(https://github.com/vaadin/vaadin-combo-box/blob/master/src/vaadin-combo-box.html) you'll see that the vaadin-combo-box-dropdown-wrapper is not a 'part' so it cannot be styled on its own, and expanding the vaadin-text-field will effectively make the whole ComboBox larger.
So you will have to be wide enough with that box or file a feature request on GitHub.

Related

How to create a scalable multi-line button in Godot?

A Button in Godot can only hold a single line of text. I can overcome this limitation by placing RichTextLabel node inside the button.
Now the button can contain more lines of text, but its height doesn't change automatically when more lines are needed. Instead the text just overflows:
Of course I can manually resize the button to be higher, but I'd like this to happen automatically depending on the amount of text inside. Specifically, I'm generating a list of these buttons programmatically and showing inside a HBoxContainer, with some buttons having longer and other shorter text.
Is there a way to achieve this with Godot layout tools?
Since the Button is in a Container, it is in control of its rect_size. The best we can do is specify a rect_min_size. There is no layout preset to have a Control depend on children Control. So, to answer the question as posted: No, we cannot achieve this with Godot layout tools. We need some scripting.
We need to set the rect_min_size for the Button depending on the RichTextLabel. We can ask it for the height of its content with get_content_height. Which also means we need to set the width beforehand. However, it will not update right away when we set the text (we are going to use yield).
Apparently you don't want the Container to control the height of the Button. If that is the case, I think you can remove all the flags from size_flags_vertical.
About the width, since as I was explaining before we need to set the width to get the height… I suggest you let the Container expand the width of the Button as much a posible. Which mean setting both the Fill and Expand flags on size_flags_horizontal.
Then, with the RichTextLabel properly set to take as much width of the parent Button as possible, you can read it height, and use it to set the height of the rect_min_size of the Button.
One more thing: you want to set the mouse filter of the RichTextLabel to Ignore or Pass, or it will prevent pressing the Button.
This is the code I came up with:
var b := Button.new()
b.size_flags_vertical = 0
b.size_flags_horizontal = SIZE_EXPAND_FILL
add_child(b)
var l := RichTextLabel.new()
l.mouse_filter = Control.MOUSE_FILTER_IGNORE
l.set_anchors_and_margins_preset(Control.PRESET_WIDE)
l.text = "Some\nMultiline\nText"
b.add_child(l)
yield(get_tree(), "idle_frame")
b.rect_min_size.y = l.get_content_height()
I'd like this to happen automatically depending on the amount of text inside
Sadly changing the text does not resize, nor change the minimum size of the RichTextLabel. And RichTextLabel does not have a "text changed" signal. Nor "bbcode text changed" signal. Furthermore, it might not be feasible to intercept these properties (see append_bbcode et.al). It is proabaly easier to do with a regular Label.
Anyway, what I'm going to suggest for this is to make a Control that wraps the RichTextLabel, offers whatever interface you actually need, and in any method where you change the text, afterwards, you do the equivalent of this:
yield(get_tree(), "idle_frame")
b.rect_min_size.y = l.get_content_height()
(Godot 3.x)
Without using scripting, it is also possible to achieve the same goal by wrapping both nodes as sibilings within a container, for example a MarginContainer. Enable the RichTextLabel's fit_content_height property, which will result in the label expanding the container's area as much as necessary, which will in turn resize the Button.

Extendscript dropdownlist item color

Does anyone know if you can change the color of the text for specific items in a dropdown list in Adobe's extendscript ScriptUI? I know about the color section of the Script UI guide, however that says nothing about list items and I tried a few things by chance but wasn't able to find a solution.
The ScriptUI is converted to HTML5/CSS behind the scenes. Because the CSS is not exposed to the user, it is not possible to change any of the colour schemes.
You can use images for buttons to add colour to them, but that wouldn't apply to dropdowns.
I'm not certain about the other Adobe programs, but I know that creating an extension (as opposed to a script) for After Effects is a way of circumventing this restriction.

Windows Explorer Navigation Bar in PyQt

What's the best approach to mimic the Windows Explorer navigation bar in PyQt?. Perhaps a list of QComboBoxes as part of a parent class that concatenates the current item of each combo box to resolve the final path?
Is it possible to get a similar look by using stylesheets?
This is the object I need to mimic. I just want a theoretical approach about the best way to mimic it.
Thanks in advance
This is technically known as a breadcrumb widget.
There are multiple approaches to this. The closest emulation to Windows Explorer's behavior--leaving out the normally hidden line editor--involves a chain of widgets like so:
A top level parent QWidget-derived class with your implementation, which would have:
A QHBoxLayout
An arbitrary number of QComboBoxes
A QFileSystemModel from which to populate the combo boxes.
Alternatives
You could use a single QLabels with a series of hyperlinks divided by path separators if you don't care about drop-down behavior. Qt Creator does this.
If your data source is static and not as gigantic as the filesystem, you could use QToolButtons backed by a tree of QAction/QMenus. This is possibly a masochistic approach, given that you have to populate all of the actions and menus. Since that's what they are there for, though, it might be handy as part of a context-sensitive menubar or tab bar.
I was looking for such a widget too without any luck. So I've tried to implement this by myself. It's not finished yet and needs some more work, but here's the first result: breadcrumbsaddressbar.
It's based on QToolButton widgets with menu. Parts of address which don't fit are hidden like in Windows Explorer. Also the widget has auto-completion feature.
Update: there's also a C++ widget QtAddressBar which I have't tried.

How to stretch and scale a single child in a container(e.g. panel, groupbox) to fit different resolution screen? C#.net

Basically, I have an usercontrol as main container, inside which I have a few groupboxes and buttons. But, my interface controls will not be resized and positioned properly as what I expect in design interface.
I've already tried to change the anchor and dock properties but none of them serve my purpose.
I searched online and found something called viewbox in WPF, I'm wondering if there is something like "viewbox" in visual studio 2010?
Please help!
Try using TableLayoutPanel container and put your controls in it. It is similar to the idea of table in HTML where it is divided to rows and columns each one of them can be set to either a set of pixels or a percentage. Usually if you want to use re-sizable form, usually you should have a control that will give you good results when stretching such as image, multiline textbox etc... In addition, put the dock property to fill to get the stretching you want.
I hope this info was useful for you.

Group box with title as Check box

I am using Visual Studio 6.0 (VC++ with MFC) in Windows XP platform. I am trying to create a group box with the title of the group box as a check box. My intention is this: If the check box is enabled, the controls inside the group box should be enabled; or else disabled.
Is this possible to accomplish? If yes, please give me some directions.
Thanks.
There are a few things you can try, depending on how true you want to stay to your idea and how much work you are prepared to put into the effort:
Simple method
Use a normal group box, and then inside this make the first item be the checkbox. This is simple to accomplish, but you lose the goal of having the checkbox as the title.
Funky drawing method 1
Use a normal group box, then in the space over where you know the title is to go, place your checkbox. You will have to perform some tricky calculation to get it to fit in nicely and draw well without flicker.
Funky drawing method 2
Use some form of superclass or subclass/subclass on the group box. You can override the WM_PAINT handler to draw in only the frame for the group box. Place a normal checkbox in the place where you know the title is to go. This should work better because you will have more control over the drawing, but it is likely to be tricky to get right. In my experience, subclassing is lower risk to implement than superclassing.
Are you using the Dialog editor? If so, put down the group box. Next, on top of it, put a check box over the line of the group box. Edit the resource to set the Z order, or do it in code. You want the checkbox to be on top of the group box. Add a handler for the checkbox and enable / disable controls depending on the check box state.
I wrote one called CGroupCheck a few years back and it's available from CodeProject: http://www.codeproject.com/KB/buttons/groupcheck123.aspx

Resources