Forums › Forums › SIMPOL Programming › New Form in New Window
- This topic has 21 replies, 2 voices, and was last updated 11 years, 2 months ago by Michael.
- AuthorPosts
- February 19, 2013 at 8:45 pm #2117MichaelKeymaster
On 18/02/2013 19:23, kromkowski wrote:
> On 02/18/13 1:52 PM, Neil Robinson wrote:
>> I am unclear why you aren't just using the same functions from the appframework for this window as well. Just hook up the menu and
>> toolbar events from the new menu and toolbar objects to the same functions.
>>
>> Ciao. Neil
>
> Well, because it doesn't or didn't work.
>
> Maybe if there was an application framework example with multiple
> windows, I'd see it.
>
> The first problem is that I was trying to avoid Error 3 (In building a
> test program, I want to start first by building this as an SBME
> application because I want to work out kinks with SBME before I go to
> PPCS because there are aspects of PPCS that I don't fully get.)
>
> My main form has a primary table and then uses many secondary tables in
> detail blocks.
>
> In order to avoid the error 3, I have to pass the app which has all of
> the open tables I need. If I open them again, I will get error 3.
>
> If you look at
>
> app =@ Myapplication.new(mb,tb,sb,"","")
>
> you are passing intial menubar and toolbar
> before you even create an initial appw.
>
> Here is the way I am thinking about it.
>
> I have an app it has the datasources and tables I'll need
>
> the app then has all of the appw s I will need
>
> each appw.w has its own forms, mb, tb, sbHi John,
This is only for creating the initial application object and window. Secondary windows would also use either the same or different
tool bars and menu bars (though if using the same ones, you would still need to call the create routines and make duplicates of
the menu bar and tool bar objects, since they can't be physically present in more than one window concurrently). The application
object has a newwindow() method that you can call. It takes care of ensuring the data sources are shared among all windows. To
open a new form in the new window, you just call openformdirect() again. It will inherit the application object's data sources and
everything will still work as expected.Ciao, Neil
February 19, 2013 at 11:01 pm #2123JD KromkowskiParticipantOn 02/19/13 3:45 PM, Neil Robinson wrote:
> On 18/02/2013 19:23, kromkowski wrote:
>> On 02/18/13 1:52 PM, Neil Robinson wrote:
>>> I am unclear why you aren't just using the same functions from the appframework for this window as well. Just hook up the menu and
>>> toolbar events from the new menu and toolbar objects to the same functions.
>>>
>>> Ciao. Neil
>>
>> Well, because it doesn't or didn't work.
>>
>> Maybe if there was an application framework example with multiple
>> windows, I'd see it.
>>
>> The first problem is that I was trying to avoid Error 3 (In building a
>> test program, I want to start first by building this as an SBME
>> application because I want to work out kinks with SBME before I go to
>> PPCS because there are aspects of PPCS that I don't fully get.)
>>
>> My main form has a primary table and then uses many secondary tables in
>> detail blocks.
>>
>> In order to avoid the error 3, I have to pass the app which has all of
>> the open tables I need. If I open them again, I will get error 3.
>>
>> If you look at
>>
>> app =@ Myapplication.new(mb,tb,sb,"","")
>>
>> you are passing intial menubar and toolbar
>> before you even create an initial appw.
>>
>> Here is the way I am thinking about it.
>>
>> I have an app it has the datasources and tables I'll need
>>
>> the app then has all of the appw s I will need
>>
>> each appw.w has its own forms, mb, tb, sb
>
> Hi John,
>
> This is only for creating the initial application object and window. Secondary windows would also use either the same or different
> tool bars and menu bars (though if using the same ones, you would still need to call the create routines and make duplicates of
> the menu bar and tool bar objects, since they can't be physically present in more than one window concurrently). The application
> object has a newwindow() method that you can call. It takes care of ensuring the data sources are shared among all windows. To
> open a new form in the new window, you just call openformdirect() again. It will inherit the application object's data sources and
> everything will still work as expected.
>
> Ciao, Neil
>Did not see app.newwindow()
I'v been using appwindow.new(app, etc)
I've come across and figured out the mb, tb issues – the definition of
"making duplicates" required some thought on my part.let's say I get the initial mb from passed app
function myFunction(wxmenuitem me, type(application) app)
appwindow appw, appwNew
appw =@ getappwindowfromwindow(getmenuitemwindow(me))
//appw is the intial appw
//appw.mb is the intial mb
wxmenubar mbNew
mbNew =@ wxmenubar.new()
//but
mbNew =@ appw.mb
//does not really create a duplicate mb it just makes mbNew "refers" to
//the initial mb(appw.mb) which means that when I do appwindow.new()
// the menubar or toolbar magically jumps from initial window to
//second window
//but you can't do mnNew = appw.mb
//so basically I have to call something like mbNew =@ mainmenu()February 19, 2013 at 11:40 pm #2126JD KromkowskiParticipantfunction myFunction(wxmenuitem me, type(application) app)
appwindow appw, appwNew
appw =@ getappwindowfromwindow(getmenuitemwindow(me))
// this doesn't work
appwTimes =@ app.newwindow()
//even if I do this first
appwTimes =@ appwindow.new(visible = .false)? appwTimes =@ appw.app.newwindow() No not that either>
On 02/19/13 6:01 PM, kromkowski wrote:
> On 02/19/13 3:45 PM, Neil Robinson wrote:
>> On 18/02/2013 19:23, kromkowski wrote:
>>> On 02/18/13 1:52 PM, Neil Robinson wrote:
>>>> I am unclear why you aren't just using the same functions from the
>>>> appframework for this window as well. Just hook up the menu and
>>>> toolbar events from the new menu and toolbar objects to the same
>>>> functions.
>>>>
>>>> Ciao. Neil
>>>
>>> Well, because it doesn't or didn't work.
>>>
>>> Maybe if there was an application framework example with multiple
>>> windows, I'd see it.
>>>
>>> The first problem is that I was trying to avoid Error 3 (In building a
>>> test program, I want to start first by building this as an SBME
>>> application because I want to work out kinks with SBME before I go to
>>> PPCS because there are aspects of PPCS that I don't fully get.)
>>>
>>> My main form has a primary table and then uses many secondary tables in
>>> detail blocks.
>>>
>>> In order to avoid the error 3, I have to pass the app which has all of
>>> the open tables I need. If I open them again, I will get error 3.
>>>
>>> If you look at
>>>
>>> app =@ Myapplication.new(mb,tb,sb,"","")
>>>
>>> you are passing intial menubar and toolbar
>>> before you even create an initial appw.
>>>
>>> Here is the way I am thinking about it.
>>>
>>> I have an app it has the datasources and tables I'll need
>>>
>>> the app then has all of the appw s I will need
>>>
>>> each appw.w has its own forms, mb, tb, sb
>>
>> Hi John,
>>
>> This is only for creating the initial application object and window.
>> Secondary windows would also use either the same or different
>> tool bars and menu bars (though if using the same ones, you would
>> still need to call the create routines and make duplicates of
>> the menu bar and tool bar objects, since they can't be physically
>> present in more than one window concurrently). The application
>> object has a newwindow() method that you can call. It takes care of
>> ensuring the data sources are shared among all windows. To
>> open a new form in the new window, you just call openformdirect()
>> again. It will inherit the application object's data sources and
>> everything will still work as expected.
>>
>> Ciao, Neil
>>
>
> Did not see app.newwindow()
>
> I'v been using appwindow.new(app, etc)
>
> I've come across and figured out the mb, tb issues – the definition of
> "making duplicates" required some thought on my part.
>
> let's say I get the initial mb from passed app
>
> function myFunction(wxmenuitem me, type(application) app)
> appwindow appw, appwNew
> appw =@ getappwindowfromwindow(getmenuitemwindow(me))
> //appw is the intial appw
> //appw.mb is the intial mb
> wxmenubar mbNew
> mbNew =@ wxmenubar.new()
> //but
> mbNew =@ appw.mb
> //does not really create a duplicate mb it just makes mbNew "refers" to
> //the initial mb(appw.mb) which means that when I do appwindow.new()
> // the menubar or toolbar magically jumps from initial window to
> //second window
> //but you can't do mnNew = appw.mb
> //so basically I have to call something like mbNew =@ mainmenu()
>
>
>
>
>
>
>
>February 22, 2013 at 3:52 pm #2127MichaelKeymasterOn 19/02/2013 23:01, kromkowski wrote:
> I've come across and figured out the mb, tb issues – the definition of
> "making duplicates" required some thought on my part.
>
> let's say I get the initial mb from passed app
>
> function myFunction(wxmenuitem me, type(application) app)
> appwindow appw, appwNew
> appw =@ getappwindowfromwindow(getmenuitemwindow(me))
> //appw is the intial appw
> //appw.mb is the intial mb
> wxmenubar mbNew
> mbNew =@ wxmenubar.new()
> //but
> mbNew =@ appw.mb
> //does not really create a duplicate mb it just makes mbNew "refers" to
> //the initial mb(appw.mb) which means that when I do appwindow.new()
> // the menubar or toolbar magically jumps from initial window to
> //second window
> //but you can't do mnNew = appw.mb
> //so basically I have to call something like mbNew =@ mainmenu()Exactly, you have to call the creation routines for each one, since otherwise they will move about (they can't be in more than one
window at a time).Ciao, Neil
February 22, 2013 at 3:59 pm #2128MichaelKeymasterOn 19/02/2013 23:40, kromkowski wrote:
> function myFunction(wxmenuitem me, type(application) app)
> appwindow appw, appwNew
> appw =@ getappwindowfromwindow(getmenuitemwindow(me))
> // this doesn't work
> appwTimes =@ app.newwindow()
> //even if I do this first
> appwTimes =@ appwindow.new(visible = .false)
>
> ? appwTimes =@ appw.app.newwindow() No not that either>integer e
e = 0
appwTimes =@ appw.app.newwindow(error=e)
if appwTimes =@= .nul
// examine what e contains
end ifCiao, Neil
February 22, 2013 at 5:24 pm #2130JD KromkowskiParticipantappwTimes =@ appw.app.newwindow(error=e)
This line throws 21 object not found. It does not trap the error in e,
it just stops execution right there.On 02/22/13 10:59 AM, Neil Robinson wrote:
> On 19/02/2013 23:40, kromkowski wrote:
>> function myFunction(wxmenuitem me, type(application) app)
>> appwindow appw, appwNew
>> appw =@ getappwindowfromwindow(getmenuitemwindow(me))
>> // this doesn't work
>> appwTimes =@ app.newwindow()
>> //even if I do this first
>> appwTimes =@ appwindow.new(visible = .false)
>>
>> ? appwTimes =@ appw.app.newwindow() No not that either>
>
> integer e
> e = 0
> appwTimes =@ appw.app.newwindow(error=e)
> if appwTimes =@= .nul
> // examine what e contains
> end if
>
> Ciao, Neil
>February 25, 2013 at 8:14 pm #2133MichaelKeymasterOn 22/02/2013 17:24, kromkowski wrote:
> appwTimes =@ appw.app.newwindow(error=e)
>
> This line throws 21 object not found. It does not trap the error in e,
> it just stops execution right there.That is because error 21 is not trappable. It is "object not found" and usually the sign of a syntax error or passing .nul to
something that is expecting a value.Ciao, Neil
>
> On 02/22/13 10:59 AM, Neil Robinson wrote:
>> On 19/02/2013 23:40, kromkowski wrote:
>>> function myFunction(wxmenuitem me, type(application) app)
>>> appwindow appw, appwNew
>>> appw =@ getappwindowfromwindow(getmenuitemwindow(me))
>>> // this doesn't work
>>> appwTimes =@ app.newwindow()
>>> //even if I do this first
>>> appwTimes =@ appwindow.new(visible = .false)
>>>
>>> ? appwTimes =@ appw.app.newwindow() No not that either>
>>
>> integer e
>> e = 0
>> appwTimes =@ appw.app.newwindow(error=e)
>> if appwTimes =@= .nul
>> // examine what e contains
>> end if
>>
>> Ciao, Neil
>>
> - AuthorPosts
- You must be logged in to reply to this topic.