How to add scrolling option on component parameter GUI? - dymola

I'm using Dymola but I expect OpenModelica might very well be the same (or at least similar).
For a given component model sometimes it makes more sense to have lots of parameters shown on one "tab" of the parameter GUI. This can lead to an excessively long GUI which, for many reasons including for psychological reasons in relation to how humans process information, is not a appropriate solution.
To solve this I would like to add a vertical scroll bar on the parameter GUI. I believe I saw it once though I cannot recall exactly where.
For illustrative purposes look to the right side of your web browser window. That gray bar that goes up and down is the scrollbar :). I know, obvious but you never know.
I assume I need to put some command in an annotation somewhere though where and what command I am not sure. For example, I found some reference to a verticalScrollBarPolicy but alas, I can not find any documentation on this.
Anyone know how to do this?
EDIT #1:
Dymola (and Adrian indicated OpenModelica as well) will automatically create the scroll bar when the GUI gets larger than the screen. Unfortunately (at least in Dymola) there is little margin so if you GUI is a fraction smaller than the window the "OK" button will be covered by the ribbon on the bottom of the screen and the GUI will be needed to made slightly larger to make the scroll bar appear automatically. This is a reason why a manual option for a scrollbar would come in handy.

I think additional "tabs" might help?

As far as I know in OpenModelica we have a scroll bar for that dialog windows if the window would expand out of the screen.

As of this posting my understanding based on feedback on this forum, my own experience, and from additional discussions with others there is no current manual control of the GUI (i.e., size, scrollbars, etc.).
Your best bet if you come across issues (e.g., you have a super small 2nd monitor) is to use lots of tabs and keep descriptions very short (which is probably appropriate for most applications anyways).
This is a Dymola and OpenModelica issue not a modelica issue as it is not contained in the modelica specification (as I understand it).
If this changes and I find out about it I'll remove or update this post.

Related

Access custom right-click menus

I have written an app that makes extensive use of custom right-click menus on an Access form. The code works great and the user loves it, but lately I am having trouble making it work properly.
In earlier versions of Access it worked well, but newer version seem much more limited in how many items can be put in such menus. The documentation is silent on the matter, and nobody in any newsgroup has had any useful ideas, but I regularly get random error about stack space, out of memory, and general lockups when populating the menus. Doing a C&R used to help, but now even that is not enough, and some menus I can no longer populate at all.
I tried building an app that just built menus until it crashed, to get some idea of what the limits may be, and I am well below what that indicated, but the experimental app had nothing else, while the real app has a great deal else.
Is there any information on how much stuff can be put into these menus, and what the menus share space with? There may be something I can do another way to make more room for the menus. I tried moving all code out of the form, leaving only event stubs that called routines in standard code modules, but that did not help.
And how are they stored/activated? The app is MUCH slower to load when it has these menus, even though no code is running on start-up.
********** Edited to add this:
I use VBA to create a menu, like this:
Application.CommandBars.Add "RCStat", msoBarPopup, False, False
then add it to a control. like this:
Application.CommandBars.cboStat.ShortcutMenuBar = "RCStat"
I add controls (only popups and buttons) like this:
Application.CommandBars.Controls.Add(type:=msoControlPopup)
Application.CommandBars.Controls.Add(type:=msoControlButton, Parameter:="StatKod = 77")
It runs perfectly and the menu items work exactly as expected, except that it bombs after adding some number of controls. It doesn't seem to matter where I add them, just the total number of added controls hits some undefined threshold, and the app crashes.
I got the original code from Getz, Litwin and Gilbert, 2000 edition. Back then, it worked great. But as the versions advance and the app accumulates data, it is becoming less and less functional. However, there are only around 10,000 records, and the app itself is less than 100MB - nowhere close to any of Access's upper size limits.
Pete,
I've done quite a bit of work with shortcut menus, and created the Access Shortcut Tool about 5 years ago, but have never attempted a menu with so many controls although some have 3 or 4 levels.
I am not aware of any restrictions on the number of elements in the commandbars collection, but I find that shortcut menus with too many options, like lists and combo boxes with too many items, are difficult for users to navigate. I generally break these up into segments and use buttons in the form header to display the appropriate menu. Sorry I'm unable to provide anything more helpful.
Dale
We have a commercial product, Total Access Components, that includes as one of its 30 components a right click popup menu that can include icons and font styles.
Here's the info for the popup menu control: https://fmsinc.com/MicrosoftAccess/controls/components/popup-menu/
There's a free trial if you want to try it.

Prevent application from warping/moving the mouse/cursor

My issue is KiCad related however it applies to other programs as well.
In KiCad under the schematics editor if you right click, move the mouse and then left-click the cursor will be placed back where you first right-clicked.
According to some answers (see launchpad below) this is not a bug it's a feature, so the developers are reluctant to make it an optional feature. There is a similar feature concerning warping the mouse when zooming in, which is optional.
My question is therefore if it is possible to block certain programs from moving the mouse cursor? i.e.
$ kicad --mousewarp=0
I have seen several requests for this on forums and as bug requests on launchpad:
https://forum.kicad.info/t/mouse-jumping-feature-removal/7077
https://bugs.launchpad.net/kicad/+bug/816739
Also a video on the issue at youtube:
https://www.youtube.com/watch?v=VtpipzDhyBY
An interesting observation is that if you select OpenGL in the pcb editor, the mouse does not warp, but there is no such alternative in the schematic editor.
Short answer: No.
The application sets the mouse cursor based on its needs. While this is annoying in the case you mention, it can be useful in others.
Long answer: Yes, but you may need to create your own input driver and ignore the XWarpPointer() calls.

How to swap two wxWindows in two different notebooks?

Our app is build on wxWidgets and designed to work on two displays. Each display has one wxAuiNotebook which in turn have one wxGLCanvas that we're rendering to.
I'd like a hotkey to be able to switch the two wxGLCanvas windows, so the user experience is that the canvas that was on Monitor #2 is now rendering to #1 and vise versa. (There are a bunch of toolbars and widgets surrounding the canvases, but I don't want them to switch displays.)
wxGLCanvas is a subclass of wxWindow, so I'm guessing it can happen at the level. What functions calls should I be looking at to accomplish this?
Sorry about the vagueness of my question. It aligns with my level of understanding of wxWidgets.
You could indeed use Reparent(), but for two wxGLCanvases it would make much more sense to simply use pointers to them in your code and just flip them when you want to switch them because it's just their contents that matters and not the windows themselves.

Template 10:Using MasterDetail along with Hamburger Template

I am using template 10 for developing a UWP app and i'm using hamburger template so when a user clicks on a particular category i would like to navigate him to a event list in a master detail view where on left is complete event list in that category and on right selected event details.There is a sample provided and its difficult to understand and don't know how to use the sample in my app along with hamburger navigation.Also as an extra feature if the user clicks on a particular category the hamburger panel should hide and masterdetail view of event should come.And when user click on back button the panel should appear again with that page.
If anyone could help me it would be of great help.Thanks in advance.
There is a really detailed sample in the repository. It has 2 examples in total. 1 a control being developed by a community member. The other is a design based around using basic XAML with visual states along with responsive triggers for screen sizing.
I've implemented the response non-usercontrol variant and it works very well. The other control based scenario has some good features and is being updated often for feature additions and corrections.
Master Detail Sample
I think what you might be looking for here is a slightly simpler thing that we are able to give you. Master/Detail is certainly not splitting the atom. That being said, it's not just a drag and drop thing either. Your are going to need to take a look at the sample. Try to reproduce it exactly into a blank project. It's a great resource, but it's not a control for you to use as much as a sample for you to refer to. I certainly wish I had a simpler answer for you, but this is going to take a little effort on your side to understand the mechanics and implement it. In the end, once you pass that "ah ha" moment, I think you will look back and realize it's simpler than you thought. But until you understand how it works at a fundamental level, it's just going to continue to confuse you. I agree with #mvermef that the visual-state approach (the primary approach) is the easiest and uses the skills you will want to learn for future development, too. But, to that end, please recognize there are TWO approaches in that sample. One uses view-states and the other uses a custom user control. If I were you, don't pick the second approach. The first approach will be easy to understand, easy to implement, and wonderfully helpful to understand for other things later down the road.

LINQPad: Anyway to make the Dump() results be initially collapsed?

Couldn't find it anywhere (google or stackoverflow).
Is there a way to force Dump()'s output to be automatically collapsed?
Update:
Some more info, to bring more focus to the question.
As mentioned below Collapsing can be done after the output as rendered via keyboard shortcust (Alt+1, Alt+2, Alt+3)
And can rendering depth can be determined by passing an int depth param, but that does not allow to expand the results.
Is there some way to change the CSS formatting? I'm not that fluent in CSS, so this might be the solution.
Why I need this:
What I want is to make the output 'cleaner', and dive in when something of interest show's up.
I'm running a query repeatedly, and don't need all of the output all the time, but still using my human abilities to detect change, instead of coding the detection.
Update: November 2013
As Joe (the author himself!) mentions in the comments, LINQPad no longer has the limitation described.
It is now possible to state 0 and collapse the information after it's rendered.
No, although you can call Dump with a number to force it to display to that nesting depth:
.Dump(0)
You can also use the formatting shortcuts (Alt+1, Alt+2, Alt+3) to collapse the whole display to one, two or three levels.
Another option is to dump to grids. Call Dump(true) or use the toolbar button. Grids show only one level and subsequent levels are shown upon demand with hyperlinks.