Is it possible to programmatically let another GUI application show above my current GUI application? - user-interface

As the title suggests, say, I have launched two GUI window applications (e.g. both are implemented by myself through Qt C++) on Linux. When a user clicks on a button in App1's form, App1 will send a socket message to App2 and App2 will pop a form immediately. What I want here is to let App2's form show above App1's form. Is it possible?
I know that inside App1, I am able to control the relative layer position between two forms. But is it possible to control the relative layer position between two applications?

Related

Google Scripts Deploy as web app- how to disaply different gui form on click event

I built a google gui web app that has basically two gui screens. The first gui screen has some text entry fields and when the user clicks 'submit' it should pull up the second gui screen displaying some results.
my second gui starts off the same as the first:
function displayForm2(hwEntered){
var app = UiApp.createApplication().setHeight('800').setWidth('600');;
var panel = app.createVerticalPanel();
...code and stuff...
app.add(panel);
return app;
}
How do I make it work as a web app?
You should build your 2 GUI in the same Ui instance but on 2 separate panels inside a single vertical panel. Then you just have to setVisible(true) one panel while you setVisible(false) the other one... you can do that either with client handler or server handler, a matter of choice but the client handler is faster and simpler if the button doesn't have other function.
The 'parent panel' (vertical or horizontal) will ensure that each panel will show up at the same place in your display.
You should easily find some explicit examples on this forum

2 way communication between WebControl and Win32/MFC

I am working on a win32/MFC application; in this application I have embedded WebControl on dialog.
when application is launched then it will load web page, in that user will enter some fields and then press submit button.
Once user presses the submit, then server will process that data and displays some unique ID to user.
Now our requirement is, we don’t want to display that unique ID on the web page instead, that web page needs to send that data to our client application(Win32/MFC).
To do this I found a solution:
Calling C++ function from JavaScript script running in a web browser control
is this is the right way to do it or is there any other solution is there.
Please help me to solve this problem
Override OnGetExternal (or if you host in your own window, change your IDocHostUIHandler::GetExternal implementation) and return a pointer to a CComTarget that has an appsubmit method exposed via automation. Change the web page to add an onsubmit handler that calls your method with the value of a hidden field
return window.external.appsubmit(uniqueId);

NSPasteboard: Getting the name of the application that initiated a drag and drop session

My Cocoa app can receive Drag operations from other applications.
Is there a way to determine which other application initiated the drag (i.e. from where the data is coming from)?
I've implemented - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender, but I could not find this kind of information in the dragging info object.
Use case: Users can select text in Safari and drop it into my app. I'd like to tell from which website the text was pasted.
Thanks!

How to best handle user state when multiple browser windows share same session?

I have a web application (Java, Websphere, JSP) which allows co-workers to register visitors to various company exhibitions. A user object is stored in the session which records the currently selected exhibition and this is used when entering the details of new visitors.
One user has decided to open a second browser window which seems to share the same session. The user browses to an other exhibition in the second window. This changes the state of the currently selected exhibition. Back in the first window a menu item is clicked: 'List visitors'. The resulting list is a list of visitors to the exhibition selected in the second window.
I know that I could add the exhibition id to every form on every page but my actual scenario is more complicated that the one I have described.
What is your stategy for dealing with this kind of problem?
My first guess would be you can avoid the problem by keeping (or perhaps only identifying) view state in the URL and not the session.

Windows Messages Minimize App on Minimize Child

I have a delphi application where the main form is a login form - this contains various database and user objects necessary for the program. Once the user logs in, I hide this form and open another.
My issue is, how do I cause the application to minimize when the child form is minimized? I figured out how to restore the child when the main is restored using windows messages, but I can't figure out how to get the app to minimize so when they click on the taskbar they only have to click once - not once to minimize and then again to restore.
Any help is appreciated - I was trying to use the NCACTIVATE - but that causes endless loops in some cases with print dialogs and other windows...
Thanks,
Christy
The best way I have found is a slight change in architecture. You don't want your login form to be your application's main form. You can fix this two different ways, but since you are maintaining your database controls on your login form then I think this is the ideal way.
Choose a different form to be your main form and set it up to be created first.
In your DPR, create your login form manually with loginForm := TLoginForm.Create(nil) instead of using Application.CreateForm.
Show the login form before your Application.Run. When you are done with it just hide it instead of freeing it.
Ideally you should move all the database components into a DataModule so you can free your LoginForm once login is complete.
Why not make the main form the existing child form, put the database logic in a data module, and create and handle the login form manually? This is the pattern that I generally use:
Create a datamodule which will be
auto-created FIRST in the list (before
the main form). Tee datamodule in the
OnCreate will initialize the database
and display a login form which is NOT
in the auto-create list, and is
created and handled entirely in the
datamodule. If I need a splash
screen, then the datamodule also
provides that functionality in the
same manner.
The mainform OnCreate checks to insure
that the user logged in successfully,
if not then calls
application.terminate;
i use TMinModal to minimize my app when a non-main form is minimized.
http://vvv.truls.org/pascal/Units.Delphi/UI/MinModal.pas

Resources