Use bottom AND top actionbar - android-actionbar

I'm actually working on an app where I want to have 2 icons in my top actionbar, and 2 icons in the bottom action bar. To split actionbars, I put
<!-- To support below API Level 14 -->
<meta-data android:name="android.support.UI_OPTIONS"
android:value="splitActionBarWhenNarrow" />
this code fragment into my manifest, and it worked. Now I have two actionbars, and I can also change the order of my icons by using the android:orderInCategory flag. But this doesn't work for the settings button, I can change its orderInCategory flag the way I like, it always stays at the bottom right corner. The second problem is, that NONE of my buttons appears in the top bar, all of them are always in the bottom bar. Any tips on how to solve those two things?
Cheers

Related

How to collapse Gtkmm notebook tabs?

So I am making a Gtkmm application using a Gtk::notebook and during run-time I'm adding new tabs to the notebook. But when I add more tabs than there is space on my screen it just keeps going moving out of the screen.
Now I know most Gtk widgets have a lot of properties that can be configured, so I'am wondering is there such a property for notebook that automatically collapses tabs or scales them in some way to make it fit inside the widget/screen.
If not it would be great if you could give me some pointers to how to implement this functionality myself.
set_scrollable() is your best bet. It will add scrolling arrows on the sides of the tab labels at the top when there isn't enough room to show them all.
Note that GtkNotebook will always ask for enough space to show the contents of all tabs, not just the one that's currently visible. If one of your tab pages is really big (say, contains a 10x10 grid of 100x100 buttons), you won't be able to resize the GtkNotebook smaller than that tab page (in that case, 1000x1000 + the height of the label area), even if the current tab page is just an empty container. All set_scrollable() will do is let you resize smaller than the width needed to show all tab labels at the top.
Put this in your .xml GUI file in the GtkNotebook object:
<property name="scrollable">True</property>
This causes the tabs that go out of screen to be horizontal scrollable by adding arrows beside the last tab at the right and the most left tab at the left.

Python tk scrollbar behavior (Windows to blame?)

I'm coding a GUI in Python/Tkinter that includes a listbox with a scrollbar. I've gotten the scrollbar operating as expected (i.e. you can click and it scrolls up/down through the listbox contents), but something's off with the way scrollbar itself behaves. The image below should help clarify.
The listbox is sized for 8 lines and contains only 12, so first off the slider should be a lot larger (2/3 of the scrollbar length). Second, whenever I scroll down (regardless of how I do it), the slider stays 'glued' to the top of the bar. This prevents me from ever using the upward fast-scroll method where you click above the slider but below the arrow -- so upward scrolling is limited to using the arrow and going one line at a time. A downward fast-scroll works fine, although as noted the slider still stays 'glued' to the top. I can click and drag the slider down, but then it pops right back up to the top. Clicking the arrows (either up or down) works normally.
I've tried using the alternative scrollbar in ttk, but it's not really any better:
In this case the slider fills the entire bar and you can't fast-scroll either direction, up or down. Grab-and-drag works (somehow), the listbox scrolls but you get no visual cue as to how close you are to the top or bottom. The arrows (again) work normally.
In short it's usable, but just very glitchy and weird. Is all this just a known limitation with using Python/Tkinter on Windows OS? (My machine has Windows XP (32-bit) with SP 3. It's Python version 2.7.3.)
It sounds like you aren't configuring your scrollbars correctly. You have to make a two way connection. You need to configure the listbox to know about the scrollbar (so that it updates the thumb) and you need to configure the scrollbar to know about the listbox (so that it scrolls the contents of tne listbox).
The behaviour you describe makes it sound like you forgot to do the former. Perhaps if you show us your cod we can confirm that. Are you doing something like the following?
my_listbox.configure(yscrollcommand=my_scrollbar.set)
my_scrollbar.configure(command=my_listbox.yview)

MFC dock at bottom right

I have a pane in an C++ MFC app that I want to dock bottom right as shown in orange in this image. Currently it is going right across the bottom (red).
see http://screencast.com/t/kSpPhvZkgBGj
This is how the user can do it in VS2008.
http://screencast.com/t/kSpPhvZkgBGj
What position is this called? How can I get the same effect?
It depends on the order the panes are created. I developed a software that even has two interface versions, with completely different layouts.
Outlook Layout:
Ribbon Layout
As you can see in the Outlook layout the 3 panes at top got at the left in the Ribbon layout; and the information bar moved from the top to the bottom.
This got some annoying work to be done. I used CDockablePane entities. Are you using them?

Making an MFC CTabCtrl not use the full control width for drawing tabs

We have a somewhat involved request for a change in our application, which is to make one of our tab controls only have access to part of the width of the control for the purposes of drawing the tabs, so that we can stick some additional status text in the remaining area on the side.
A picture would probably help:
As you can see, the tab control extends all the way to the right of the dialog, but we want a reserved area for "Total Inventory Cost", and we want to make sure that additional tabs (which are common) don't encroach onto that area.
I'm open to pretty much any means of implementing this, short of completely rewriting the application. We can switch tab controls if there's one out there that works better, or otherwise change the implementation of the tab setup within reason.
I would have thought that one could separately set the client area and the tab drawing rectangle areas separately, but that doesn't seem to be the case. Please correct me if I'm wrong.
Any help appreciated!
If I understand correctly, what you've got is this
Main window's client area:
-> tab ctrl occupying the enttire area
-> some other controls on top of tab control
What you could do is this
Main window's client area:
-> Small tab control at the bottom
-> All othe controls in main window's client area

Positioning QPushButtons via qss in QT

I have a set of five buttons that I am trying to position in a qss file. The default position that I have set up in the ui file works for one of the layouts I need. However, I want to group the buttons differently in the other theme.
I am new to qss files and have been experimenting, but cannot figure out if some things are possible. The "left" property is defined here: http://doc.qt.io/archives/4.6/stylesheet.html#left-attr but nothing happens when I try to use it.
margin-left actually moves the button, but only relationally. So, if the buttons are positioned in the ui file with a gap of 100 between them, a margin-left for the second button in the list is offset by 100.
What am I doing wrong? Could it be some setting in the ui file that is preventing it from moving? I already "broke layout" and it doesn't seem to matter. Is there a good resource you'd suggest?
Here is a sample of my qss file. The left has no effect.
QPushButton#Button_1
{
min-width: 50;
max-width: 50;
min-height: 50;
max-height: 50;
position:absolute;
subcontrol-origin: border;
left:200;
}
EDIT:
I've figured out that I can change the position of the button by deriving a class from QPushButton and making a "GeomX" qproperty. This seems to work, but I am running into an odd issue now. When I first load my app, it draws the buttons as they are positioned on the ui file. When I use the "change theme" option that I've coded, and select the currently loaded theme, it moves the buttons as I'd expect. However, resizing the app dumps them back to the ui positions and restarting also places them back in their ui positions. Is there a setting in the ui file that I could alter to get it to stop moving them? Is there a load-order issue that I need to address? Is it possible to even address this? What is going on?
Generally speaking, style sheets in Qt are used to alter the way a widget is drawn, not where it is positioned (except to add padding/margin). As the documentation you've referenced mentions, the "left" property is specific to sub-controls (that is, components within a widget and not the widget itself).
What it sounds like you're trying to accomplish (change the layout depending on the theme) would likely require a different approach. A couple of options would be to react to when the theme changes by:
Moving around your spacers in your layout to move the buttons to the desired position
Using a stacked widget, one page in the stack for each layout you desire, and change which page in the stack you're showing depending on what theme you're using.