Adding several nodes as TabPane content - user-interface

I am currently trying to add some content to a tabPane with the method:
tab.setContent(label, combobox);
Sadly this method only allows me to add 1 component to my tab so how do I work around this limitation? Do I need to create a new class and add that stage as a component or is there another way?
Update:
I'm sorry my original question was not clear enough here is a brief explanation:
So I've created my GUI in JavaFx Scene builder and i have created a tabPane where i have three different tabs. All of which needs to contain different things now depending on which button you click on in my GUI i want to change the content of the tabs therefore i need to write the code my self my.
My problem is that i want to add components to my tab manually yet i am unable to because the tab.setContent method allows me to only add 1 component! also i am unable to set the component where i want it to be it kinda stays in the top left corner!

Use any layout manager as content:
FlowPane pane = new FlowPane();
pane.getChildren().addAll(new Label("Hello"), new Label(", world"));
tab.setContent(pane);

Related

User Interface on Top Rajawali Surface View

Anyone who knows how to add User Inteface on top of Rajawali Surface View?
I check the rajawali documentation but it doesn't work
The following approach worked for me: Create your UI elements that you want to add to your layout, I used a ConstraintLayout as a container. Do not create the SurfaceView by xml, but instead programmatically. Create it in a way that it will overlap all other UI elements and that it uses all available space. By this, the UI elements are still visible even though technically they should be hidden by the SurfaceView which is in front.
Below is my code how I setup the SurfaceView. Note that constraintLayout is the name of the container layout that has other buttons in it as well.
surfaceView = new SurfaceView(getContext());
surfaceView.setFrameRate(30.0);
surfaceView.setRenderMode(ISurface.RENDERMODE_WHEN_DIRTY);
surfaceView.setSurfaceRenderer(YOUR_RENDERER);
surfaceView.setLayoutParams(new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MATCH_CONSTRAINT, ConstraintLayout.LayoutParams.MATCH_CONSTRAINT));
surfaceView.setId(View.generateViewId());
constraintLayout.addView(surfaceView, 0);
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(constraintLayout);
constraintSet.connect(surfaceView.getId(), ConstraintSet.LEFT, ConstraintSet.PARENT_ID, ConstraintSet.LEFT);
constraintSet.connect(surfaceView.getId(), ConstraintSet.RIGHT, ConstraintSet.PARENT_ID, ConstraintSet.RIGHT);
constraintSet.connect(surfaceView.getId(), ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM);
constraintSet.connect(surfaceView.getId(), ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP);
constraintSet.applyTo(constraintLayout);

Lotus Notes: view opened from outline in new tab on web

I have an outline which contains some outline entries.
Every entry contains a view and in the outline entry properties at Content there is the name of the frame. Also, every view in its properties at Auto Frame (web only), there is the name of the frame.
Even so, when I click another view to open it, it will b open in a new tab of the browser.
I appreciate your time and help!
PS: I observed this problem after I put the suggestion code ( which it works ): Lotus Domino: View pagination on web .
If I remove the code from OnLoad it works quite well, with no openings in new tab. Is there any chance to have the code on OnLoad event and the views to be open in same frame?
By changing the value of window.name, the pagination code is affecting the name of the frame in which the content appears. So when you click a link in the outline, the browser goes to look for the window/frame with the name specified by the outline, and it can't find such a one -- so it opens a new window with the specified name.
For the pagination code to not interfere with your navigation, you would have to change it to not rename the window -- it would have to store its window-identifier elsewhere. For instance, if you know the view will appear in a frameset, you could set a property of top instead of window. Since the top window of the frameset doesn't change when you load new pages within a frame, you can even just keep track of the last Start= parameter there, and not bother with cookies.
I encourage you to look into using XPages for your web design -- this is usually simpler.

How to create multiple windows using "command + n" in non document based application

Is there a way to create/enable having multiple windows using "command + n" in a non document based application? I want to have unlimited instance of that window (not actually unlimited, but might be 6-7 instances) using command + n
Or I have to create a document based app and port all my code in new project template is the only solution?
I can see the menu button for "New" is disabled right now.
A few ways to do this.
First connect the New menu item to an IBAction method.
Name the method whatever makes sense to you.
Next, you will want to add some kind of property to your controller ( app delegate for simplicity ) that is basically a window stack only storing a reference to each window or window controller. NSMutableArray should do nicely.
Now you can do the next part a few ways, but I would recommend creating an NSWindowController subclass with a nib/xib (especially if these windows will have the same basic things in them).
Do what you want in the nib file.
Now in your IBAction method, create a new instance of your window controller class, add it to your mutable array. Tell it to load its window.
You only have to decide if the controller should be removed from the stack and set to nil if its window is closed.
Many ways to handle that, and up to your design to know what is correct.
Try this :-
NSWindowController *yourWindow=[[[[yourWindowController alloc]init]retain]autorelease];
[yourWindow loadWindow];

How to fix overlapping objects on the stage in AS3

I have a flash game where I have a picture designed to be the textbox for a prompt and textbox inside with the relevant text but the textbox is being hidden by the image. Anyone know how to make is so that the textbox is guaranteed to be on top or whatever I need to do to keep this from happening?
The other answer using setChildIndex will definitely work, however, I think a different design approach is really what you should be doing to remove the headache altogether.
For example in a game I might have different layers such as :
backgroundLayer
gameLayer
interfaceLayer
Those 3 Sprite layers would get added to the stage in that order. I would then add display objects to the appropriate layers. So anything I added to the backgroundLayer or gameLayer would ALWAYS be 'behind' my user interface on the interfaceLayer.
That allows you to not have to worry about the layering constantly. The answer with setChildIndex will fix the problem for that moment, but should something else be added to the container it will overlap your textbox, which is something I don't assume you want.
here's an example :
var backgroundLayer:Sprite = new Sprite;
var gameLayer:Sprite = new Sprite;
var interfaceLayer:Sprite = new Sprite;
addChild(backgroundLayer);
addChild(gameLayer);
addChild(interfaceLayer);
now, whatever you add to interfaceLayer, will ALWAYS be on top of objects you add to gameLayer or backgroundLayer.
So in the case of your text box, just add it to your interfaceLayer and any other objects you want behind it, you add to the gameLayer or backgroundLayer.
The order of adding display objects to display object containers effect their z-order, in other words the front to back order. The last added display object becomes the frontmost. So the child index of the children of a display object container is important for drawing of overlapped children.
If you put picture and text on the same DisplayObjectContainer such as a MovieClip:
Lets say your DisplayObjectContainer is mc.
And your textbox is txt
Please try this:
mc.setChildIndex(txt, mc.numChildren-1);

chrome-like status bar in qt

I'm not big on creating GUI's, and generally my philosophy is: I don't create them, or I make them as simple as possible (and convince myself that it's better for usability :)
For my current project, I'm using Qt from Python (PyQt), and I want to start adding some GUI elements without cluttering the interface.
My idea is to create these elements as sort of floating-shaped-widgets that only appear when necessary; pretty much like the status bar (and find bar) in chrome.
Is there any standard api that enables creating this kind of interface?
This is not very complicated. If you want something like the status bar in Chrome you just need to have a QFrame at the bottom of your windows and show or hide it when you need it.
You have 2 options here, add is as part of your window layout so all the items move up when it is shown. Or you can have if floating, so it will be shown on top of the items. For the second option you need to create the QFrame with the window as parent and then in the window resizeEvent set the geometry of the frame.
This is an example of the second approach:
void MyWindow::resizeEvent(QResizeEvent* event)
{
frame.setGeometry(0, this->height() - frame.sizeHint().height(), this->width(), frame.sizeHint().height());
}
I hope this helps.

Resources