How to stop the horizontal scroll bar from showing when window is resized? - horizontal-scrolling

I have this website http://www.claybrookeanimalfeeds.co.uk/index.php which I want to be able to keep the content in the middle of the page. Now I've got it so that most of the content stays in the same place when the window re-sizes, however the problem is that when I re-size the window to half the size of the screen, a horizontal scroll bar appears but when you move the scroll bar to the right, there's nothing there and it's just a blank space.
Is there anyway that I can make so that the content stays in the same place without a scroll bar appearing when I re-size the window?

Instead of using percentages as your widths for the containers, use a pixel value.
Example: #content { width: 800px }

Related

Get the vertical scrollBar object of certain column in pyqt's QColumnView class

There is a QColumnView class as shown belown. I use QFileSystemModel as its data model.
As you can see, there are four columns and three vertical scroll bars and a horizontal scroll bar.
It's easy to get the horizontal scroll bar by using self.ui.columnView.horizontalScrollBar().
But when I use self.ui.columnView.verticalScrollBar() to get the vertical scroll bar, it doesn't work properly.
So I would like to know how to get certain column's scroll bar.
When I connect a function to the horizontal scroll bar's valueChanged event by self.ui.columnView.horizontalScrollBar().valueChanged.connect(self.sync) and I move the horizontal scroll bar, the self,sync is executed.
But when I use self.ui.columnView.verticalScrollBar().valueChanged.connect(self.sync), whatever vertical scroll bar I move, the self.sync cannot be executed.

How to make a vertical slider?

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

Adjust view size in accordance with screen size

I am having problem in resizing views according to screen size changes in android studio. I have 3 image buttons adjacent to each other and I want their combined width to fill width of screen. I know that match_parent can fill the screen size but this case is different. I want each button of width as 1/3 size of screen. How can I do this?
Assuming these 3 buttons are located inside a horizontal <LinearLayout> add these tags to each button layout_width="0dp" and layout_weight="1"

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

Tab bar is also moving when i scroll the table view

I have written the code programmatically for my tab bar in my table view.The problem whenever i am scrolling the table view,the tab bar is also moving.The tab bar created in one cell,so it is also scrolling.How to keep that in static.Please help me in this.
Thanks in advance
DOn't put the TabBar in the Scrollview. Rather, have the TabBar at the bottom of the main view, and have the ScrollView extend only to the top of the TabBar. That should fix it. If you put the TabBar on the ScrollView, it will scroll around (that's what the ScrollView does).
If you're creating the tab bar as one of the cells, this will always happen. (It's the expected behaviour for the table cell.)
Why on earth are you using this approach, rather than simply putting the tab bar above or below the UITableView?

Resources