Using SmartClient:
I have a VLayout composed of a DetailViewer (that monitors selection changes in a ListGrid) and a HLayout (that holds some buttons).
Now, when the user selects rows in the ListGrid, the DetailViewer "grows" and creates a Scrollbar.
In consequence the bottom HLayout is also contained in the Scrollbar. I would like to avoid this. My intention is to have the bottom HLayout always visible (i.e. the Scrollbar would contain the DetailViewer only).
How can I do this?
(Also posted here.)
Set overflow:auto on the DetailViewer.
I am pursuing that there is only one VLayout and inside it there is one HLayout (with buttons) and a DetailViewer.
Now if you want your buttons to be always visible shift buttons on the top of VLayout and set overflow property as "visible" with some height say 50. Now second child inside VLayout should be DetailViewer with overflow property as "auto", so if required DetailViewer will show scrollbars.
Secondly, you can switch the position of HLayout and DetailViewer but do not forget to set height and overflow properties.
Thanks
shaILU
Related
Imagine a horizontal stack view that contains two controls. Hopefully the type of controls doesn’t matter. Let’s say UITextFields. They’re set to take up 50 percent of the width via distribute evenly on their parent stack view.
Now imagine that I want to add more than one of these things. To keep things simple imaging two of them nested inside a vertical UIStackView. So now we have four text views each taking up a quarter of the parenting vertical stack view.
My question is this. For every pair of text fields, how can I get a button right in between the gap between that text field and the one below it, to the right. So for each pair one button to the right and under it right in the center of the gap between the top pair and bottom pair of text fields.
The idea is to make a control consisting of the two fields and the plus sign to the right and below. Hitting the plus sign would allow for the appending of an identical set of controls.
Thanks I’m advance. Sorry if this makes little sense.
I should add that the button should overlap the vertical space of both text fields.
Okay, thank you. I shall add an image. Imagine all of the fields besides those on the far right as text fields. The ones on the far right are buttons. Those buttons would add a new set of text fields, a pair to the left side.
I'm getting some ideas in my head since writing this originally. In my head you might have one vertical stack view. That vertical stack view would contain a regular UIView containing a pair of text fields and a horizontal stack view to the right. These would be nested inside a horizontal stack view where the text fields would be aligned to the top on the left and the center or bottom alignment for the button to the right.
Does that help?
When you hit the button on the far right, you'd get a new pair of text fields plus a new button.
Okay, I think I'm getting somewhere. Now all I have to do is work out how to do it entirely programmatically so I can add the views dynamically...
Have the buttons be in their own vertical stack view, with each button having the same height as the row of the control pairs, but the top layout margin of the buttons vertical stack view would be set to half the height of the control pair so that the buttons always appear in the middle.
In summary you'd have a horizontal stack view which contains two vertical stack views - one with the pairs of controls, and one with the buttons. you'd add a button and a pair of controls (which are arranged in a horizontal stack view of their own) on every tap on the button
I currently have a stack view that is horizontal, fill, fill equally. Inside, there are 3 generic views with different coloured backgrounds.
My current problem is that, when I set one of the views inside to hidden=true, the other two views immediately expands to fill the void. I don't want this. All I want is for the space to remain blank and the target view to be "invisible" both graphically and to UI input events.
Instead of setting isHidden=true you could set view.alpha = 0 to make it invisible and also view.isUserInteractionEnabled=false to disable UI input events.
*As #robmayoff pointed out below the isUserInteractionEnabled=false is not actually required.
As I can see in your screenshot, you are using the constraints. So, when the element hides, collapses and the other expand.
Use 'opaque' flag to make it invisible.
I have a THorzScrollBox in a form, and some TStyledControls inside. Each StyledControl has a Tag to identify. Using an TEdit to inform a value, I can find inside the ScrollBox an specific Control by his tag.
If the control that I searched is not on the screen, I want to scroll the ScrollBox to show it.
How can I do this programmatically?
I found a way to do this.
I have to use ScrollBy. But the detail is that if I want to scroll the controls to right I have to use a negative value.
Example:
sbItems.ScrollBy(-10, 0); // this will scroll to right
If I use a positive value, it will scroll to left.
sbItems.ScrollBy(10, 0); // this will scroll to left
The point is, if you scroll once, the ViewportPosition will change and the next time you execute ScrollBy, it will not reset the scroll position, it will scroll from the point you already have scrolled.
I am using the VirtualTreeView together with the OnMeasureItem event to display rows of variable size. The problem is that the event seems to be called only if a row is painted (following the virtual paradigm). But this leads to the scrollbar being displayed incorrectly. If I scroll to the bottom (by dragging the scrollbox with the mouse, not clicking the scroll buttons at the top or bottom), not the last row is displayed (which is what I would expect), but some row in the middle. After that, the scrollbar is updated and I can scroll further down. It seems as if the component uses the DefaultNodeHeight for its scrolling calculations. But since my rows have variable height, I cannot specify a DefaultNodeHeight that would lead to correct results. Option toVariableNodeHeight is enabled.
Has anyone experienced this before and maybe found a workaround? Or am I doing it wrong?
You need to set DefaultNodeHeight to the maximum value you will be using and OnMeasureItem event set custom height value for the current node. Similar issue was described here.
If I fill a ListBox with items, will a vertical scrollbar automatically appear when there are too many items to display, or is there something that needs to be set for this to occur?
ListBox only shows a vertical scroll bar when there are more items then the displaying area.
You can play with ListBox.ScrollAlwaysVisible Property if you want the bar to be visible all the time.
YES, that it will.