How to make an eclipse partstack not disappear when the last part is closed? - eclipse

I'm working on a project with a main window consisting of a mpartstack where I add parts dynamically from another part. The problem is that when the last part gets closed the mpartstack disappears and the other part takes up all the space. When I try to add new parts nothing happens.
I've tried fiddling around with the preDestroy function in the parts that are added to the stack by trying to add a new part. The preDestroy works occasionally but far from satisfactory.
I've looked far and wide to try to find any clue on what to do but I've found nothing except for some bug reports on the matter.
So: can a mpartstack be in a uncloseable state or is there any textbook way to intercept a part that is about to be closed?
Thanks in advance
/K

Add the tag NoAutoCollapse to the MPartStack definition in the model.

Related

eclipse RCP4 Add Toolbar to Parts

How to model a toolbar ONCE and render it in some Parts/Views (not in the default place which is the window!)? Using the model level (and maybe Addons?)
I have currently
Eclipse 2022.03-4.23
Application.e4xmi with that Toolbar but
Gets added dynamically using an Addon that listens to "PART_ADDED" event topic which
Leads to a NPE due to other event topic "UIEvents.Part.TOPIC_TOOLBAR" within a framework method in a class called LazyStackRenderer
So the guy before me had written an Addon to dynamically add the Toolbar to the parts. Maybe to make the buttons save/print per part or because the main layout has two stacks and only the parts stack is relevant.
Appreciate any help! I searched a lot but no success!
I solved it so far. The dynamically created MParts were not added as children to the container (in my case the PartStack) in the first place and also had to comment the adding of placeholder objects that carry the same information of the parts. This dynamic step was done as a reaction to the topic #UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) in some written Addon.
I am not a 100% sure that discarding the placeholders is safe but still this is the best trail I have ever reached.
I hope this would help others!
Thank you #greg-449

C# flipping mainwindow

this is my very first entry here, may it not be the last....
I am having a bit of a struggle with some GUI stuff.
I really have an animation up front my eyes and it should look like the following: using c# with desktop application.
This Form looks like a login window with server address, username and pw textboxes and with a connect button as well, so nothing special. Size wise it can be small or at least same as size as the turned window. doesnt matter at the end.
once you entered your credentials and all turns out to be fine, connection is there and valid.
The main Form is suppost to flip then (doesnt matter horizontal or vertical),
and shows you your options you got then in this newly window. kind of an animated sign, that you are logged in and have now these options.
But the flip is suppost to stay on the same place. Like a card flip or a coin flip, but just the whole form and it ends then at the same place as before.
(sounds really wired to explain)
This can also be done with a new form poping up, just with a animated turn over, no problem with that.
And this is exactly where I am stuck.
I really cant find any information on how this would look like in code or even in animation.
I am using c# and the basic project started as a desktop application project, which it will be at the end.
Its been a while since my last coding, please be gentle.
i know there are plenty of entries in here also in google as well, but i didnt found anything which will do this for the main window as a total. images etc: yes, but for the whole form: no.
Any help out there?
May be tehr eis a trick i am not aware of? Its been a while since the last coding work, I need to admit that.#greyhairsarecomming
many thanks in advance! much appreciated
kind regards TG

Access Pop Up Form Background Garbled/Distorted When Opened via OpenForm Macro Action with Window Mode Normal

I have a database that I work on using Access 2013, though I must maintain compatibility with Access 2010; I am using Windows 7.
I have an input form that is set to Pop Up = Yes, and Modal = No. When opening this input form directly from the Navigation Pane, it functions perfectly normally.
I have a macro in a search form that calls up this input form with the specified record using the "OpenForm" action. When opening the input form with this macro, the form's background is totally garbled (it pulls the background image from whatever was behind it when called, as though it were transparent), and all labels are unreadable.
That said, if I run the macro again by trying to open a different record, the form then appears correctly until it is closed. Also, if I change the "Window Mode" in the "OpenForm" action to "Dialog" rather than "Normal," it appears correctly.
Neither of these are valid solutions, though -- it should work on the first time, and I do not want the form to be modal. All my code seems okay (insomuch as I am not receiving error messages), so I don't understand why it would be doing this... any guidance is very much appreciated.
I have discovered what is causing this problem, though I don't understand why.
The macro I am using came from a sample database, and has some commands I am not fully familiar with. One such command is "Requery."
I experimented with removing various parts of the macro with the window mode as "Normal" for the "OpenForm" command. As soon as I tried removing "Requery" (and nothing else) the window opened in "Normal" mode with no distortion whatsoever.
In short, having "Requery" in the macro was what was causing this error to occur. It seems like an innocuous enough action (all it does is refresh data, from what I understand, as described here: https://msdn.microsoft.com/en-us/library/bb177360(v=office.12).aspx), but since I don't see why its inclusion was necessary anyway (if anyone could shed some light on that, it would be appreciated), it looks like this is essentially solved.
I hope this may help someone else in the future!

C, GTK: window stops updating

I'm developing an application that periodically draws images on a GTK Drawing Area inside a window.
The rendering first works well and the window content gets repainted if I drag another window over the drawing one, but after some random amount of time (some seconds), the window stops updating itself.
New images dont get displayed, and if I then drag another window over the rendering one I get this:
When I click one of the checkboxes below my drawing area, the window gets refreshed and the problem is gone for another few seconds.
Any idea what could make the GTK threads stop updating the window content?
I dont know which part of my code is of interest to answer that question, so I pasted the mostly full version here.
My GTK-main() is called like this:
void window_main()
{
pthread_create(&drawing_thread, NULL, img_draw, NULL);
gtk_main();
gdk_threads_leave();
}
Thanks for any hints! :)
Found the solution: in the original example code I used (here) they use a g_timeout_add() to register their periodic drawing function.
The g_timeout_add()-registered function is run by gtk_main(), which means it is protected internally by gdk_threads_enter() and gdk_threads_leave(). That's the point I was not aware of.
Surrounded my call to gtk_widget_queue_draw_area() with these two functions and the bug is gone 8)

Prevent main form from appearing when showing another form

I am trying to bring my secondary form to the Foreground, however when I do
MyForm.Show; // It may be hidden, therefore show it first
SetForegroundWindow(MyForm.Handle);
my Main Form appears aswell. The only way I can prevent that is to do MainForm.Hide; but I got to avoid that.
The idea is to have my secondary form appear on top of another application, without my Main Form having to do so as well.
If you consider to make another application for this functionality, then you may also consider the following compromise: minimize the MainForm to the taskbar (rather than hiding it) to prevent it popping up when activating another form.
If so, then try this answer. It does add an extra icon to your taskbar for the secondary form, but I guess that'll be no problem since a different application would either. However, if the MainForm is nót minimized but obfuscated by other windows, activating the secondary form wíll also popup the MainForm, just like you are experiencing now.
And for the completeness of this answer's sake, but not by any means meant as advice: this answer describes a (somewhat experimental) construction to make fully independent windows. The little time I tested that solution, it seemed to work, but be prepared not counting any longer on the full/default functionality of the VCL.
Try settings the state of the form to fsAlwaysOnTop.