Prev: touchpad programming
Next: Visual Basic.net
From: David on 28 Apr 2010 11:48 What I had in mind is this: I have a set of tools that are used as overlays on charts that are updated in real-time. If I use my menu choices (here MDI menu) or another form (vbmodal not child) -- no -- impact occurs on the real-time chart display. However, if I use the tools which are used on the same Picturebox, the real-time chart is impacted as it is in the same master loop as charting. I have attempted to resolve this by buffering the chart data, -- wait for an opening (delay) -- send the chart data to the buffer then use the tool. When the tool usage is completed, I dump the buffer to the chart and continue with real-time. The above was done based on an Appleman article I read years ago regarding event conflicts, VB, and phasing While the above works, at times users complain because of the delay either in the tools or the chart. Logic says if I could make the tools modal (like the menus) . However, the big kicker is that both the charting and tools may be drawing to the same bitmap (picturebox) at the same time. "Dee Earley" <dee.earley(a)icode.co.uk> wrote in message news:OljT$du5KHA.5464(a)TK2MSFTNGP05.phx.gbl... > On 28/04/2010 15:31, David wrote: >> A form can be Modal. Menus also appear to be Modal. >> >> Is there anyway to create an object and make it modal (independent) >> of the form or any control on the form? > > I assume you mean a singleton, where only one instance can exist at a > time? > A single global variable or maybe a factory function that creates one if > needed and just returns the same instance. > > -- > Dee Earley (dee.earley(a)icode.co.uk) > i-Catcher Development Team > > iCode Systems > > (Replies direct to my email address will be ignored. > Please reply to the group.)
From: Bob Butler on 28 Apr 2010 12:41 "David" <NoWhere(a)earthlink.net> wrote in message news:eYFIApu5KHA.3184(a)TK2MSFTNGP05.phx.gbl... > What I had in mind is this: > > I have a set of tools that are used as overlays on charts that are > updated in real-time. If I use my menu choices (here MDI menu) > or another form (vbmodal not child) -- no -- impact occurs > on the real-time chart display. However, if I use the tools which are > used on the same Picturebox, the real-time chart is impacted > as it is in the same master loop as charting. > > I have attempted to resolve this by buffering the chart data, > -- wait for an opening (delay) -- send the chart data to the buffer > then use the tool. When the tool usage is completed, I dump the buffer > to the chart and continue with real-time. The above was done based on an > Appleman article I read years ago regarding event conflicts, > VB, and phasing > > While the above works, at times users complain because of the delay either > in the tools or the chart. > > Logic says if I could make the tools modal (like the menus) . However, > the big kicker is that both the charting and tools may be drawing to the > same bitmap (picturebox) at the same time. I'm still not exactly clear on what you are describing but I think you are trying to get to multi-threading which is not simple in VB. It has nothing to do with anything being "modal". I'm assuming that the real-time chart display is reacting to some external event that causes part or all of the chart to be updated. If you call a procedure in your "tool" that does a lot of calculations and drawing but does not yield time for the chart events to occur then they will pend until the tool finishes. It might be as simple as adding DoEvents inside the tool to let the chart catch up. You might also need to look at threading, which is possible in VB but requires care, or using an ActiveX Exe for the tool to isolate those calculations and let it raise events back to update the charts.
From: David on 28 Apr 2010 12:48 Mr Johnson: I guess my question centers mostly around menus and how they appear to be independent. You would think -- my logic -- that the form would be the parent and the menu would be an object under the parent form. When the master parent (form) loop is processed by the OS, the other loops -- menu, any controls, etc. -- should be processed as a subset under the parent (form) loop. So how does the menu become "semi-modal"? "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:%23jB1uiu5KHA.1924(a)TK2MSFTNGP06.phx.gbl... > "David" <NoWhere(a)earthlink.net> wrote in message > news:e$WMI%23t5KHA.6052(a)TK2MSFTNGP02.phx.gbl... > >>A form can be Modal. Menus also appear to be Modal. >> >> Is there anyway to create an object and make it modal (independent) >> of the form or any control on the form? > > Modal means that when the given object is activated, no object in its > parent hierarchy will be responsive to either mouse or keyboard input. > Only forms are truly modal; menus are semi-modal. You cannot make controls > modal. Ever. >
From: Nobody on 28 Apr 2010 13:24 "David" <NoWhere(a)earthlink.net> wrote in message news:uJneUKv5KHA.5464(a)TK2MSFTNGP05.phx.gbl... > Mr Johnson: > > I guess my question centers mostly around menus and how they appear to be > independent. You would think -- my logic -- that the form would be the > parent and the menu would be an object under the parent form. > When the master parent (form) loop is processed by the OS, the other > loops -- menu, any controls, etc. -- should be processed as a subset > under the parent (form) loop. > > So how does the menu become "semi-modal"? What event triggers the master loop? Is it a Timer or something else?
From: Jeff Johnson on 28 Apr 2010 13:42
"David" <NoWhere(a)earthlink.net> wrote in message news:uJneUKv5KHA.5464(a)TK2MSFTNGP05.phx.gbl... > I guess my question centers mostly around menus and how they appear to be > independent. You would think -- my logic -- that the form would be the > parent and the menu would be an object under the parent form. > When the master parent (form) loop is processed by the OS, the other > loops -- menu, any controls, etc. -- should be processed as a subset > under the parent (form) loop. > > So how does the menu become "semi-modal"? Because the operating system has special handling for menus. |