I would like to implement a "Module Switcher" in my application, which brings up an alt-tab like interface showing the open modules.
Right now it is structured like this
ModuleShellView
ModuleSwitcherView
Module 1 Module 2 Module 3
ModuleSwitcherView is opened as a dialog from ModuleShellView and binds to the currently open Modules.
This causes the active module in the screen behind to transition to nothing. Is there a way to keep the view open in the background, while displaying it in another dialog? The alt-tab window only needs a "view" of the view, it doesn't need to be interactive.
I have found a workaround for this. Rather than show the contentcontrol, I am grabbing the view instance, writing it to a WriteableBitmap and then using that.
Related
I'm working on pretty simple web side that cointains login screen (almost same as in demo presentation, white page with login and password) and main screen with sidebar and navigation bar. How should it be done? My plan is to build main screen using navigation bar, sidebar (just few buttons in layout basicly) and few layouts with content of the webside. On each button click change layout used to create content to another one, for example for Schudele button I'm gonna load layout that contains some tables, for About button plain text. Is it good idea?
So finnaly is should look like this:
init() function decides if user is logged or not and display Login page or Main page, Main Page is builded from modules like navbar, sidebar and content, content depends on sidebar buttons click. I'm right?
Handling it on your own is legit way to start or learn Vaadin. If you have a first grasp of this works out, the most common way to handle such a scenario is the use of the Navigator See the book of Vaadin.
With the Navigator you define Views and give them a name, register them with the Navigator. Then you can navigate your application with the Navigator, it takes care to give you nice ...#!view... URLs so the Users can have bookmarks and navigate your app also e.g. with the back button in the browser.
The Navigator hooks into an event system, where listeners (ViewChangeListener) can react to "before enter" and "leave". The "before enter" can be used to realize auth needs, since they are allowed to object entering a view.
I made my GUI using Qt Designer and I have a QTabWidget with multiple tabs. My tabs contain specific tools that are used in my app. Now I would like to set my tabs closable and movable so I could save the order of my tabs and load it when the app starts. The problem is, I don't know how to reorder my tabs when the application loads. Is this possible?
You can move tabs by accessing the QTabBar object associated with the QTabQidget
QTabBar has a method moveTab() which will allow you to reorder tabs.
So you would do something like my_tab_widget.tabBar().moveTab(old_position, new_position) where old_position and new_position are integers which specify the tab to move and the position to move it to respectively.
Lots of details in the c++ documentation (it translates to python pretty easily). See QTabBar docs and QTabWidget docs
Is it possible to use forge functions like request.ajax() and prefs.get() inside tabs.openWithOptions() opening a local html file ?
No, the modal view that opens when using the tabs module is designed to act more like a browser window and not allow access to forge methods.
Is there a reason you want to open a local page in a modal view? You should be able to use Javascript/CSS to display a modal dialog in your app without navigating to a different page.
I have a requirement to create a ipad app that supports tab to view content. I have created a custom splitview controller, whenever user goes to a particular section in the left section, the contents related to that will be displayed in the content view(right view). If a user selects a particular link in that content view it should open a tab and display the contents of that link in that new view. Similar to Web Browser tabs i need to handle tabs in this app. Please suggest any available open source component or any ideas to implement tabbing inside a ipad app.
You can use Three20 for your tab purpose. Also there are many open Source components available. You just need to search in google.
I have to do a clean up of some app generated files, when the application is completely closed. The close can happen from any screen. Which method or where should i override globally to caputure Menu Close event, rather than overriding onClose() on each screen of the application ?
And when the application is closed using Menu Close in the middle of the application, is onClose() called for each screen on the stack and are popped off the stack, or it just removes the application from memory ?
I don't believe there's a method that does exactly what you want but I think you can get the behavior you want. First off, based on the testing I've done the close menu item simply calls onClose() for the current screen. The default close menu item does not close the entire application, it just closes one screen.
The closest method I can think of is deactivate(), this is called when the app is sent to the background but not when it's actually closed (i.e. this method will be called if you press the red "end call" button but not if you press close in the menu). This would probably be overkill but what you could do is select "Auto-run on startup" and "Do not display the application icon on the BlackBerry home screen" in your BlackBerry App Descriptor. This would make the app invisible to the user so that it's always in the background, to have an icon on the homescreen and display a GUI you would create an alternate entry point that will bring up the UI. Then when the user selects the close menu item all it's really doing is sending the application to the background and you can put your cleanup code in deactivate().
A much better approach would be to just override onClose() in a parent class and then just make all of your screens inherit from that class. You can put your cleanup code in there. Or if you want the close menu item to close all screens override the makeMenu() method and add a MenuItem that will execute the appropriate cleanup code before calling System.exit().
In my app, I just have all the screens inherit from a common parent class. In that parent class, I implement my standard exit handling.
The correct place to put code that runs when a screen is popped is Screen.onUiEngineAttached(boolean). That method gets called when a screen is actually pushed or popped from the display stack. The other methods are only relevant if you are overriding the behavior of menu items or dirty screen handling.
Another option would be to have a single listener object that handles all this behavior, and use Screen.addScreenUiEngineAttachedListener() to subscribe it to all screens before pushing them on the display stack.