How to make a vertical slider? - livecode

I need a vertical slider similar the standard slider. Is there a way to modify the existing one or do I need to make a new one?
The standard slider would work for me. I just need it to work vertically.
Perhaps I should better clarify my issue with the standard slider.
Yes, I can drag the size of the slider and it will be vertical. The problem is that when you select the value of the slider to show the text gets buried in the low side of the slider when you slide it down all the way. It essentially gets cut off and only shows the top half of the slider value character. I find no way to correct this by moving the shown text up a little so it all shows. I see no way to change text vertical or offset position in the properties setting.
The text settings only allow you to change the text format to right, center and left justify. There is no setting that can move the text up to prevent it from being cut off when the slider is all the way to the lower or down position.
The value text shows ok on the top of the slider. The problem is on the bottom side when you set the slider to be vertical.
It looks like the the show value setting does not place the value on the top layer of the slider and it gets hidden behind something else in the slider object.
LC9, Windows 10

I think I'm understanding your question. If you just resize the horizontal slider control so that the width is narrower than the height, the orientation of the slider control will automatically change to vertical.

Apparently it is a bug in this version of LC. At least in Win which is where I am testing.
Putting the scrollbar vertically cuts the value when it reaches the bottom.
But I found a solution so that it does not cut. Play around with the properties of the font. Such as size and family. In my case it worked fine by lowering the font size by one pixel.
Default: Segoe UI font, size 12
I just set the size to 11 and it doesn't cut anymore.

For what it is worth, I do not see this issue on a Mac. A vertical slider works as advertised. Font size makes no difference.
Are you saying that in the horizontal mode, you do not see this, but when changed to vertical, you do?

Try creating a scrollbar and a text field.
Set the scrollbar's showValue property to false and copy the following script to your scrollbar. Note that your field must be called "scroll value".
on scrollbarDrag pNewPosition
local tLoc
lock screen
# The Current Loc of Field
put the loc of field "scroll value" into tLoc
# New Position of scrollbar
put pNewPosition into field "scroll value"
# New Loc of Field
put the mouseV into the item 2 of tLoc
set the loc of field "scroll value" to tLoc
set the left of field "scroll value" to the right of me
unlock screen
end scrollbarDrag

Related

Style Grid border in case Grid height is calculated

I have a case which want to get vaadin-grid the maximum height possible in screen.
So, this is easy.
the problem is that despite the vaadin-grid size is ok, the tbody might be shorter than vaadin-grid.
So, whenever there is not enough rows we get empty space.
it would be ok in case had no border. But, because we do use border on the grid, empty space comes up.
Sure can shift the border to thead and tbody and get it looks good, but than the opposite happen cause bottom border will get lost when tbody in longer than vaadin-grid.
Is there a clean way, non dirty js, to distinguish cases? something else?
Thanks
I think you should be able to get at least very close by using the :host([overflow~="bottom"]) state attribute selector. Add/remove the borders based on that. The overflow attribute value changes based on if rows are overflowing the from the bottom of the grid viewport.
The only issue I see is that the border will disappear when the user scrolls to the bottom of the grid.

Why does Excel 2010 VBA userform textbox font changes depending on size of frame?

I have a userform with several frames, labels, and textboxes, all set to a default font of Calibri Regular size 10. I noticed the font in one textbox was different than the rest; a bit slimmer, a hair shorter and more condensed than the default. I tried adjusting the font in design and runtime, messing with the font of the frame, and replacing the textbox with a new one, but nothing seems to correct the font.
Then, by accident, I moved the textbox position up a bit and the font automagically corrected itself. Weird. I've since been playing around with the textbox position and frame size. This is what I've observed:
1) The font size is dependent on the relative position within the frame; the textbox needs to be entirely in the top 50% of the frame height, and adjusting the textbox position OR frame height affects the font.
2) This issue applies to more than one frame on this userform.
3) This issue applies to labels as well as textboxes.
4) This issue is inconsistent and does NOT apply to all textboxes and labels; it's just the textboxes affected in the first frame, just the labels in a second frame, and there is no font issue in a third frame.
I've gone over the properties in all frames, labels, and textboxes in design mode and nothing stands out. All of these controls have the same font set. Has anyone ever encountered this issue before? Is this a known bug?
Same as #SquirrelBait - I too have found that the display size of the font changes in appearance depending on where it is positioned on my UserForm (created at Design time - Excel 2016). This occurred within a Multipage, but may not be relevant.
Although I don't have a solution, I may have a possible work around:
The issue only seems to occur where the Height of the Form Control (Label, TextBox, ComboBox) isn't an integer value. I auto sized some of my Controls so they were given Heights of 14.25, 28.5, 20.25 etc. I've increased all the Heights to integer values. Now the issue appears to be resolved.
I also had success changing my textbox heights from 17.5 to 18. In my case I also had them slightly overlapping (to create a table effect), which despite them being 18 font, still caused them to have a slightly larger text size. After I changed it so that the bottom of one is the top of another, everything seems to be working fine now.

How to align the button horizontally and vertically in Document?

I want to align the button horizontally and vertically in Document, i now ho to align horizontally, but i can`t undestand how to align vertically?
In picture bellow, button align horizontal, but how align vertically, in option button i don`t find something about align vertically.
Vertical align is possible in tables only.
Create a table with one row and one column. Set wanted height as "Minimum height" and "Vertically align" to "Center". Content will be centered vertically this way.
I know, it is just a workaround, but it works. Of course, set "Cell Border Thickness" all to 0 so table border is invisible.
If those are 2 buttons, why don’t you just put a ‘return’ (CR) between them. The 2 buttons will be positioned one below the other.
If need be, you can size the buttons, so they have the same width via the properties.
There is no option to "fit to window" vertically in normaal Notes form and document display. It assumes an infinitely long document consisting of paragraphs.
There is, however, the option of displaying a document using the #DialogBox formula or the NotesUIWorkpace.DialogBox method. Both of those have an auto vertical fit argument that you can provide. This will likely require you to redesign your application a bit, but I think it's the only way to do what you want.

Motif: How to move Scroll Bar automatically without user intervention

I have a scrolled window in my application, in which I have created a drawing area widget. In the drawing area, I have placed multiple images. When the user enters information about an image in a search box, the appropriate image gets highlighted.
My problem is how do I get the application to scroll automatically to the highlighted Image box without the user using the scroll bar. The scrolledwindow should automatically move the view region, to display the region where the highlighted Image is present.
The scrolling policy used on the scrolled window is XmAUTOMATIC.
Any pointers would be greatly appreciated.Thanks in advance.
Try XmScrollVisible() if this does not work then you will need to:
1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.
HTH

Why is Autofit Labeling greyed out?

I Have created a bar chart in a 2007 .xls file, but the data labels cannot be resized. When you go to the "format Data Labels" and then click on alignment, the Autofit and Internal Margin option is grayed out. Anyone know why?
Short version: It is greyed out for chart text, because it the option doesn’t apply.
Long version:
This is because on a chart, chart text do need to use margins, rather you can you can just move the text., and set its X and Y position. For example take the Chart Title, if you want more space to the left, just click and drag the title to the right. If you want the chart title to be bigger you just set a larger font, you have complete control over the title, as well as all other text on that chart, axis titles, legends, data labels, etc.
Internal margins are meant to be used when you don’t have complete control take for example text in a shape. If you insert a shape in your workbook, and add text to it, you cannot just pick the text up and move it to the right if you want more space on the left, so you can set the margin.
Here's a trick that worked for me:
My problem was: I added more text to the axis title and it was too long for it's original shape so some text went into second line.
My solution: I type the complete text somewhere else, copy the text, double click on the axis title and delete the original text -- the cursor would still be there -- now insert the copied text. Done! They are all in one line!
Partial solution to resize label to a single line: Data labels in a chart will often wrap themselves, when you dont want them to. They would often seem better in a vertical single line above the graph item. Reset them to one single line by editing the text in the label, deleting the Excel imposed return, and replace it with a space. The line, and label box, will resize to fit a single line. However because you have "manually interfered with the lable, it will no longer update for changing graph data. You would have to double click each lable then reset it. Most annoying.
A way around it is to make the chart area big. The data label boxes will resize to fit the words in one line. Then make the chart small (not the chart area).
Manually insert a textbox into the bar chart and type in the label that way. It's annoying and labor-intensive, but it works.

Resources