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
- January 29, 2013 at 10:24 pm #176JD KromkowskiParticipant
I’m testing with SBME the concept of opening second window with second form. (Instead of swapping form in same app window.) I keep getting an error 3. Is there no way to do this without going to PPCS. (I can of course I suppose do this with wxforms and send over the data I need.) I am able to do it personal, by opening datasource and table in new windows, first. And then I open the forms. A main form which alot of detail blocks and a second form which only has the table related to the detail. So then if I add or modify or delete data in one file the, select current (up arrow) it refreshes the data in the detail block. I just can’t quite wrap my head around doing it programatically.
January 29, 2013 at 10:34 pm #2083JD KromkowskiParticipantOn 01/29/13 5:24 PM, kromkowski wrote:
> I'm testing with SBME the concept of opening second window with second
> form. (Instead of swapping form in same app window.) I keep getting an
> error 3. Is there no way to do this without going to PPCS. (I can of
> course I suppose do this with wxforms and send over the data I need.)
>
> I am able to do it personal, by opening datasource and table in new
> windows, first. And then I open the forms. A main form which alot of
> detail blocks and a second form which only has the table related to the
> detail.
>
> So then if I add or modify or delete data in one file the, select
> current (up arrow) it refreshes the data in the detail block.
>
> I just can't quite wrap my head around doing it programatically.Is what is happening in Personal that I have more than one application
framework running?I can see now that I can open quite a few tables in new windows and then
forms in new windows. And so long as I open the form with the detail
blocks last I don't get an error three problem at all.January 30, 2013 at 7:40 pm #2084JD KromkowskiParticipantHere a stab at this, just to try the concept out. I can do this with a
wxform but I'd like to use a dataform. It falls down at the
opendataform(), I am thinking it is in the datasources and tables params
but I'm really not sure.function AddTime(wxmenuitem me, type(application) app)
integer error, width,height, dispwidth, dispheight
error = 0
string errortext; errortext = ""
appwindow appw
appw =@ getappwindowfromwindow(getmenuitemwindow(me))
wxwindow wTime
wTime =@ wxwindow.new(100, 100, innerwidth=1,
innerheight=1,captiontext="Test")
wTime.setstate(.false)
wTime.onvisibilitychange.function =@ quitW
dataform1 fTime
string dirsep, cd, formfilename
dirsep = getdirectorysepchar()
cd = getcurrentdirectory()
formfilename = cd + dirsep + "TimeAddMod.sxf"
fTime =@ opendataform1(formfilename,
50,
50,
1677215,
"T|F",
".",
"999999.00",
"dd/mm/yyyy",
"hh:mm am",
app.displayformats.defdatetime,
app.SBLlocale.datelocale,
app.SBLlocale.numlocale,
app.datasources.search(TIME),
appw.gettablesarray(),
error,errortext,
wTime)
width = fTime.currentpage.width
height = fTime.currentpage.height
fTime.setcontainer(wTime)
wTime.setstate(.true)
wxprocess(.inf)
end functionfunction quitW(wxwindow w)
wxbreak()
end functionOn 01/29/13 5:34 PM, kromkowski wrote:
> On 01/29/13 5:24 PM, kromkowski wrote:
>> I'm testing with SBME the concept of opening second window with second
>> form. (Instead of swapping form in same app window.) I keep getting an
>> error 3. Is there no way to do this without going to PPCS. (I can of
>> course I suppose do this with wxforms and send over the data I need.)
>>
>> I am able to do it personal, by opening datasource and table in new
>> windows, first. And then I open the forms. A main form which alot of
>> detail blocks and a second form which only has the table related to the
>> detail.
>>
>> So then if I add or modify or delete data in one file the, select
>> current (up arrow) it refreshes the data in the detail block.
>>
>> I just can't quite wrap my head around doing it programatically.
>
> Is what is happening in Personal that I have more than one application
> framework running?
>
> I can see now that I can open quite a few tables in new windows and then
> forms in new windows. And so long as I open the form with the detail
> blocks last I don't get an error three problem at all.January 31, 2013 at 12:30 pm #2085MichaelKeymasterOn 30/01/2013 19:40, kromkowski wrote:
> Here a stab at this, just to try the concept out. I can do this with a
> wxform but I'd like to use a dataform. It falls down at the
> opendataform(), I am thinking it is in the datasources and tables params
> but I'm really not sure.
>
>
> formfilename = cd + dirsep + "TimeAddMod.sxf"
> fTime =@ opendataform1(formfilename,
> 50,
> 50,
> 1677215,
> "T|F",
> ".",
> "999999.00",
> "dd/mm/yyyy",
> "hh:mm am",
> app.displayformats.defdatetime,
> app.SBLlocale.datelocale,
> app.SBLlocale.numlocale,
> app.datasources.search(TIME),
> appw.gettablesarray(),
> error,errortext,
> wTime)
> width = fTime.currentpage.width
> height = fTime.currentpage.height
> fTime.setcontainer(wTime)
> wTime.setstate(.true)
> wxprocess(.inf)
> end functionHi John,
You can do this much easier than that, by using appw.openformdirect(). It will gather up the datasources, tables array, etc. for
you. Also, have a look at that code and you will see how to call opendataform1() yourself. If you are using the appframework, you
are better off calling openformdirect(), since it will also activate a bunch of housekeeping in appwindow.Ciao, Neil
January 31, 2013 at 6:03 pm #2086JD KromkowskiParticipantappw.openformdirect() was my first instinct. But here is what happens:
It replaces the initial form with my new form (for a flash of a second)
and then opens a window as intended with the new form, leaving the
original appw without a form.See attach shot.
So in addition to being wrong there is a funky side effect that menu in
the now empty window controls the form in the side window.JDK
On 01/31/13 7:30 AM, Neil Robinson wrote:
> On 30/01/2013 19:40, kromkowski wrote:
>> Here a stab at this, just to try the concept out. I can do this with a
>> wxform but I'd like to use a dataform. It falls down at the
>> opendataform(), I am thinking it is in the datasources and tables params
>> but I'm really not sure.
>>
>>
>> formfilename = cd + dirsep + "TimeAddMod.sxf"
>> fTime =@ opendataform1(formfilename,
>> 50,
>> 50,
>> 1677215,
>> "T|F",
>> ".",
>> "999999.00",
>> "dd/mm/yyyy",
>> "hh:mm am",
>> app.displayformats.defdatetime,
>> app.SBLlocale.datelocale,
>> app.SBLlocale.numlocale,
>> app.datasources.search(TIME),
>> appw.gettablesarray(),
>> error,errortext,
>> wTime)
>> width = fTime.currentpage.width
>> height = fTime.currentpage.height
>> fTime.setcontainer(wTime)
>> wTime.setstate(.true)
>> wxprocess(.inf)
>> end function
>
> Hi John,
>
> You can do this much easier than that, by using appw.openformdirect(). It will gather up the datasources, tables array, etc. for
> you. Also, have a look at that code and you will see how to call opendataform1() yourself. If you are using the appframework, you
> are better off calling openformdirect(), since it will also activate a bunch of housekeeping in appwindow.
>
> Ciao, Neil
>January 31, 2013 at 6:50 pm #2087JD KromkowskiParticipantif app !@= .nul
appw =@ app.windows.getfirst()
appwTime =@ app.windows.tail.setnext()Am I on right track, that in the beginning, I should create the
additional windows, I'll need for later?can I access it directly like this
app.windows!appwTime
JDK
On 01/31/13 1:03 PM, kromkowski wrote:
> appw.openformdirect() was my first instinct. But here is what happens:
>
> It replaces the initial form with my new form (for a flash of a second)
> and then opens a window as intended with the new form, leaving the
> original appw without a form.
>
> See attach shot.
>
> So in addition to being wrong there is a funky side effect that menu in
> the now empty window controls the form in the side window.
>
> JDK
>
>
>
>
>
> On 01/31/13 7:30 AM, Neil Robinson wrote:
>> On 30/01/2013 19:40, kromkowski wrote:
>>> Here a stab at this, just to try the concept out. I can do this with a
>>> wxform but I'd like to use a dataform. It falls down at the
>>> opendataform(), I am thinking it is in the datasources and tables params
>>> but I'm really not sure.
>>>
>>>
>>> formfilename = cd + dirsep + "TimeAddMod.sxf"
>>> fTime =@ opendataform1(formfilename,
>>> 50,
>>> 50,
>>> 1677215,
>>> "T|F",
>>> ".",
>>> "999999.00",
>>> "dd/mm/yyyy",
>>> "hh:mm am",
>>> app.displayformats.defdatetime,
>>> app.SBLlocale.datelocale,
>>> app.SBLlocale.numlocale,
>>> app.datasources.search(TIME),
>>> appw.gettablesarray(),
>>> error,errortext,
>>> wTime)
>>> width = fTime.currentpage.width
>>> height = fTime.currentpage.height
>>> fTime.setcontainer(wTime)
>>> wTime.setstate(.true)
>>> wxprocess(.inf)
>>> end function
>>
>> Hi John,
>>
>> You can do this much easier than that, by using appw.openformdirect().
>> It will gather up the datasources, tables array, etc. for
>> you. Also, have a look at that code and you will see how to call
>> opendataform1() yourself. If you are using the appframework, you
>> are better off calling openformdirect(), since it will also activate a
>> bunch of housekeeping in appwindow.
>>
>> Ciao, Neil
>>
>January 31, 2013 at 7:03 pm #2088JD KromkowskiParticipantif app !@= .nul
appw =@ app.windows.getfirst()
appwTime =@ appwindow.new()wrong app.windows.insert(appwTime,appw)
So how to I add another window to the application?
On 01/31/13 1:50 PM, kromkowski wrote:
> if app !@= .nul
> appw =@ app.windows.getfirst()
> appwTime =@ app.windows.tail.setnext()
>
> Am I on right track, that in the beginning, I should create the
> additional windows, I'll need for later?
>
> can I access it directly like this
>
> app.windows!appwTime
>
> JDKJanuary 31, 2013 at 7:15 pm #2089JD KromkowskiParticipantappwTime =@ appwindow.new(app,.false)
On 01/31/13 2:03 PM, kromkowski wrote:
> if app !@= .nul
> appw =@ app.windows.getfirst()
> appwTime =@ appwindow.new()
>
> wrong app.windows.insert(appwTime,appw)
>
> So how to I add another window to the application?
>
>
> On 01/31/13 1:50 PM, kromkowski wrote:
>> if app !@= .nul
>> appw =@ app.windows.getfirst()
>> appwTime =@ app.windows.tail.setnext()
>>
>> Am I on right track, that in the beginning, I should create the
>> additional windows, I'll need for later?
>>
>> can I access it directly like this
>>
>> app.windows!appwTime
>>
>> JDKFebruary 1, 2013 at 5:29 pm #2090JD KromkowskiParticipantso in
function Myapplication.new(etc)
appw =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)
// I create more appwindows to use later
appwTime =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)
appwDates =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)while I see how I can get the first appwindows
e.g. in main()
appw =@ app.windows.getfirst()
and I can see how I could getlast(), I don't see how I can getnext().
nor can I seem to be able to use ! to access.
so in main() I cannot for example, do this
app.windows.appwTime!openformdirect()
JDK
On 01/31/13 2:15 PM, kromkowski wrote:
> appwTime =@ appwindow.new(app,.false)
>
>
>
> On 01/31/13 2:03 PM, kromkowski wrote:
>> if app !@= .nul
>> appw =@ app.windows.getfirst()
>> appwTime =@ appwindow.new()
>>
>> wrong app.windows.insert(appwTime,appw)
>>
>> So how to I add another window to the application?
>>
>>
>> On 01/31/13 1:50 PM, kromkowski wrote:
>>> if app !@= .nul
>>> appw =@ app.windows.getfirst()
>>> appwTime =@ app.windows.tail.setnext()
>>>
>>> Am I on right track, that in the beginning, I should create the
>>> additional windows, I'll need for later?
>>>
>>> can I access it directly like this
>>>
>>> app.windows!appwTime
>>>
>>> JDK
>February 4, 2013 at 7:04 pm #2092MichaelKeymasterOn 01/02/2013 17:29, kromkowski wrote:
> so in
>
> function Myapplication.new(etc)
>
> appw =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)
>
> // I create more appwindows to use later
> appwTime =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)
> appwDates =@ appwindow.new(me, visible=.false, mb=mb, tb=tb, sb=sb)
>
> while I see how I can get the first appwindows
>
> e.g. in main()
>
> appw =@ app.windows.getfirst()
>
> and I can see how I could getlast(), I don't see how I can getnext().
>
> nor can I seem to be able to use ! to access.
>
> so in main() I cannot for example, do this
>
> app.windows.appwTime!openformdirect()
>
> JDKHi John,
You are on the right track. Here is a code snippet for you:
appw =@ app.windows.getfirst()
while appw !@= .nul
// … whatever you want to do here
appw =@ appw.appnode.getnext()
end while appw =@= app.windows.getfirst()I think if you are always going to have these three windows, I would be tempted to add references to them to my own application
object that is derived from the standard application object. Then I could just use:app.appwMain
app.appwTime
app.appwDatesThat assumes these are full blown windows and forms of course. If you are talking about dates and times in some restricted way,
then you would probably be better off using dialogs as needed.Ciao, Neil
February 5, 2013 at 1:39 am #2096JD KromkowskiParticipantThank you.
Using appnode is not so intuitive. (I'm not actually even sure what
appnode is?And why is it that, I can't use ! (what do you call the using the !?)
app.windows!appwTime
> Hi John,
>
> You are on the right track. Here is a code snippet for you:
>
> appw =@ app.windows.getfirst()
> while appw !@= .nul
> // … whatever you want to do here
> appw =@ appw.appnode.getnext()
> end while appw =@= app.windows.getfirst()
>
>
> I think if you are always going to have these three windows, I would be tempted to add references to them to my own application
> object that is derived from the standard application object. Then I could just use:
>
> app.appwMain
> app.appwTime
> app.appwDates
>
> That assumes these are full blown windows and forms of course. If you are talking about dates and times in some restricted way,
> then you would probably be better off using dialogs as needed.
>
> Ciao, Neil
>February 11, 2013 at 6:24 pm #2097MichaelKeymasterOn 05/02/2013 01:39, kromkowski wrote:
> Thank you.
>
> Using appnode is not so intuitive. (I'm not actually even sure what
> appnode is?appnode is a dlistnode. The windows property is a dring.
> And why is it that, I can't use ! (what do you call the using the !?)
Basically because it assumes that the member operator for a dring is implemented, which it isn't, and even if it were, it would be
difficult to do what you expect, since the dlistnode contains merely a type(*) key property, and the entire object that it
contains is assigned to that property. It has no way of knowing what property of any target object should be the one used fo
resolving the string passed to the !() function.> app.windows!appwTime
Sure, it would be more elegant, but it would require some significant re-engineering to achieve. Considering how many drings and
dlistnodes are found in dataform1 and co, this would be a potentially significant engineering exercise.Ciao, Neil
>
>
>
>> Hi John,
>>
>> You are on the right track. Here is a code snippet for you:
>>
>> appw =@ app.windows.getfirst()
>> while appw !@= .nul
>> // … whatever you want to do here
>> appw =@ appw.appnode.getnext()
>> end while appw =@= app.windows.getfirst()
>>
>>
>> I think if you are always going to have these three windows, I would be tempted to add references to them to my own application
>> object that is derived from the standard application object. Then I could just use:
>>
>> app.appwMain
>> app.appwTime
>> app.appwDates
>>
>> That assumes these are full blown windows and forms of course. If you are talking about dates and times in some restricted way,
>> then you would probably be better off using dialogs as needed.
>>
>> Ciao, Neil
>>
>February 15, 2013 at 9:05 pm #2099JD KromkowskiParticipantno need to re-engineer anything.
So I am able to open new forms in new windows. I had to write my own
openformdirect() function. However, handling their menus and icon bar
is a bit more tricky. I do have it mostly working now, except I cannot
figure out how to make the form receptive to changes.I can seem to be able to get a cursor in any field. Even though a
form.blank() will create what looks like a blank form/record. I can put
my cursor in to type anything.As I am typing I am thinking something like
form.tbMyFirstField.setfocus()
?
JDK
February 18, 2013 at 6:52 pm #2111MichaelKeymasterOn 15/02/2013 21:05, kromkowski wrote:
> no need to re-engineer anything.
>
> So I am able to open new forms in new windows. I had to write my own
> openformdirect() function. However, handling their menus and icon bar
> is a bit more tricky. I do have it mostly working now, except I cannot
> figure out how to make the form receptive to changes.
>
> I can seem to be able to get a cursor in any field. Even though a
> form.blank() will create what looks like a blank form/record. I can put
> my cursor in to type anything.
>
> As I am typing I am thinking something like
>
> form.tbMyFirstField.setfocus()
>
> ?
>
> JDK
>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
February 18, 2013 at 7:23 pm #2115JD KromkowskiParticipantOn 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. NeilWell, 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
Maybe I will just start over.
If I just have one window and change the forms there is not problem at
all. I can pretty much replicate my office management program.It is when I start trying to have multiple windows each with their own
form and own mbs,tbs, etc. that things start getting complicated for me.JDK
- AuthorPosts
- You must be logged in to reply to this topic.