Forum Replies Created
- AuthorPosts
- Jean ValleeParticipant
On 5/1/2013 1:05 PM, JV wrote:
> Suddenly I'm finding myself flying blind.
> Watch window is not showing any values.
> window flashes like it's being updated when I step thru code.
> I rebooted already
> How do I get it back?
>
> Jean
I reinstalled 1.74 and still nothing. HELP!Jean ValleeParticipantOn 4/30/2013 9:26 AM, Neil Robinson wrote:
> On 30/04/2013 01:47, JV wrote:
>> On 4/29/2013 1:42 PM, Neil Robinson wrote:
>>> On 24/04/2013 13:36, Jean Vallee wrote:
>>>> I have converted a dataset from a client and I have one record with a
>>>> number field that the IDE is telling me had a value of .inf when in fact
>>>> it's 14476.10.
>>>>
>>>> I'm debugging reports now, comparing the Simpol reports to the Superbase
>>>> reports to make sure they match.
>>>>
>>>> I've retyped the value in the field and saved the record. I duped the
>>>> original record and deleted the original. I reorged the file.
>>>>
>>>> What would cause this and how can I avoid it in the future?
>>>>
>>>> Jean Vallee
>>>>
>>>>
>>>
>>> Hi Jean,
>>>
>>> Are you saying that the data as converted using the conversion tool contained a .inf value in a field?
>>>
>>> Ciao, Neil
>>
>> Yes, I used the tools provided to convert the db's. I've found a couple
>> of other records like it as well (out of 4000+)
>>
>
> I would be interested in a copy of the SBF that produced this, together with enough info to identify which record we are looking
> at. Can you make copy of the file and try and remove all data except maybe one record that shows this and which when converted
> still has a .inf value?
>
> Ciao, NeilI'll work on it later this pm. It's screwing up my reports so I must
have a solution.Jean
Jean ValleeParticipantOn 4/30/2013 9:24 AM, Neil Robinson wrote:
> On 29/04/2013 21:19, JV wrote:
>> On 4/29/2013 1:39 PM, Neil Robinson wrote:
>>> On 22/04/2013 19:43, Jean Vallee wrote:
>>>> Been trying to use wxgetscreentextextent to print white text on black
>>>> background.
>>>> However, the width in pixel returned by it is not correct. Putting ruler
>>>> to paper, it's telling me the text will be 3.11" wide when it's actually
>>>> only 2.25" (approx).
>>>> Makes it print extra black "space" at end of text.
>>>
>>> Hi Jean,
>>>
>>> This function is not tuned to use printer fonts. It can only reliably tell you how much space is required to display the text in
>>> pixels.
>>>
>>>> wxfont revfonthead
>>>> revfonthead =@ wxfont.new("Tahoma",14,"n","b","", error = e)
>>>> wxgetscreentextextent(revfonthead, "RESIDENTIAL CONSTRUCTION", width = tw,
>>>> height = th)
>>>>
>>>> // tw is now 299 – way too big – should be about 216 or so…
>>>>
>>>> integer mtw
>>>> mtw = tw/app.form.currentdpi * 25400 ;// to convert to mm
>>>>
>>>> // then I use mtw to specify a printwidth on a printform1
>>>>
>>>> Any ideas on how to make it more accurate?
>>>
>>> The result is the value in pixels. Any conversion assumes a direct relationship with a printout, which is not the case.
>>>
>>> Ciao, Neil
>>
>> Ok so how do you estimate how much space a paragraph of text will take
>> up on paper with a specified font and point size? I have many comment
>> boxes that need to be printed as part of reports and they could be a
>> single word, sentence or many paragraphs. I need to know if they will
>> fit on the page I'm currently printing or I need to break the field and
>> print what doesn't fit on the next page.
>>
>> I'm using printform1 for reports.
>>
>> Jean
>>
>
> You are trying to recreate what the graphic report engine does, although even it won't currently break a record across pages, it
> will just move it to the next page. I have an internal function that calculates the length and height of a string using the
> current Windows default printer (it is a very good idea to make sure that the default printer is the one you expect to use with
> SIMPOL). It is not a trivial piece of code.
>
> Ciao, NeilThat is why I chose printform1 over the graphic report. It is
conceivable that the comment field may be larger than a entire page.
And I always know what the destination printer for reports is (stored in
user settings table).So would you care to share your solution?
Jean
Jean ValleeParticipantOn 4/30/2013 9:30 AM, Neil Robinson wrote:
> On 30/04/2013 04:23, JV wrote:
>> On 4/29/2013 1:43 PM, Neil Robinson wrote:
>>> On 28/04/2013 16:55, JV wrote:
>>>> How do I set this property?
>>>> appw.form.currentpage.wxformpage.focuscontrol.name
>>>>
>>>> It's read only….
>>>>
>>>> I'm trying to shift focus to another field before calling a getuserinput
>>>> called from a dataform1button with an ongotfocus event.
>>>>
>>>> Per a previous thread, I know I have to change the focus prior to
>>>> calling getuserinput but nothing I've tried changes the
>>>> focuscontrol.name property so getuserinput is being called over and over.
>>>
>>> To set focus to another control, use control.setfocus().
>>>
>>> Ciao, Neil
>>
>> I did that but it did not change the focuscontrol.name.
>> so when I exit a dialog it's repeating the ongotfocus event.
>>
>> // get value at beginning
>> string x ; x = appw.form.currentpage.wxformpage.focuscontrol.name
>> // x = selcntrbtn – this control has the ongotfocus attached to it.
>> // setfocus somewhere else
>> if app.prmttype == "1"
>> me!MechName.setfocus()
>> else
>> me!ProjDesc.setfocus()
>> end if
>> // immediately test value again
>> string x ; x = appw.form.currentpage.wxformpage.focuscontrol.name
>> // x is still selcntrbtn
>>
>> Jean
>>>
>>
>
> If you are popping up a dialog in an onlostfocus event, are you setting the focus with the dialog still up? If so, wxWidgets will
> mess you over. It stores the ID of the control that last had focus when the window loses focus, and restores it when the window
> receives focus again. I have not been able to find a clean way to prevent this yet (but not for lack of trying). To solve this, in
> your onlostfocus event where you call the dialog, disable the event when going into the function, set focus to the correct control
> after you return from the dialog call, and just before exiting restore the function to the onlostfocus event for the control.
>
> I know it is messy, but it is unfortunately caused by the screwy behavior of wxWidgets.
>
> Ciao, Neil
I am not calling a dialog per se but I think getuserinput is a glorified
one…
But I am not setting focus with the dialog still up but BEFORE the
dialog is even called. Code above is followed by a getuserinput
statement so you can see where I'm setting focus to another field before
even getting to any dialog yet it still did not change.Can you tell me why the code snippet above did not change the
focuscontrol property?Jean
Jean ValleeParticipantOn 4/29/2013 1:43 PM, Neil Robinson wrote:
> On 28/04/2013 16:55, JV wrote:
>> How do I set this property?
>> appw.form.currentpage.wxformpage.focuscontrol.name
>>
>> It's read only….
>>
>> I'm trying to shift focus to another field before calling a getuserinput
>> called from a dataform1button with an ongotfocus event.
>>
>> Per a previous thread, I know I have to change the focus prior to
>> calling getuserinput but nothing I've tried changes the
>> focuscontrol.name property so getuserinput is being called over and over.
>
> To set focus to another control, use control.setfocus().
>
> Ciao, NeilI did that but it did not change the focuscontrol.name.
so when I exit a dialog it's repeating the ongotfocus event.// get value at beginning
string x ; x = appw.form.currentpage.wxformpage.focuscontrol.name
// x = selcntrbtn – this control has the ongotfocus attached to it.
// setfocus somewhere else
if app.prmttype == "1"
me!MechName.setfocus()
else
me!ProjDesc.setfocus()
end if
// immediately test value again
string x ; x = appw.form.currentpage.wxformpage.focuscontrol.name
// x is still selcntrbtnJean
>Jean ValleeParticipantOn 4/29/2013 1:42 PM, Neil Robinson wrote:
> On 24/04/2013 13:36, Jean Vallee wrote:
>> I have converted a dataset from a client and I have one record with a
>> number field that the IDE is telling me had a value of .inf when in fact
>> it's 14476.10.
>>
>> I'm debugging reports now, comparing the Simpol reports to the Superbase
>> reports to make sure they match.
>>
>> I've retyped the value in the field and saved the record. I duped the
>> original record and deleted the original. I reorged the file.
>>
>> What would cause this and how can I avoid it in the future?
>>
>> Jean Vallee
>>
>>
>
> Hi Jean,
>
> Are you saying that the data as converted using the conversion tool contained a .inf value in a field?
>
> Ciao, NeilYes, I used the tools provided to convert the db's. I've found a couple
of other records like it as well (out of 4000+)Jean ValleeParticipantOn 4/29/2013 1:39 PM, Neil Robinson wrote:
> On 22/04/2013 19:43, Jean Vallee wrote:
>> Been trying to use wxgetscreentextextent to print white text on black
>> background.
>> However, the width in pixel returned by it is not correct. Putting ruler
>> to paper, it's telling me the text will be 3.11" wide when it's actually
>> only 2.25" (approx).
>> Makes it print extra black "space" at end of text.
>
> Hi Jean,
>
> This function is not tuned to use printer fonts. It can only reliably tell you how much space is required to display the text in
> pixels.
>
>> wxfont revfonthead
>> revfonthead =@ wxfont.new("Tahoma",14,"n","b","", error = e)
>> wxgetscreentextextent(revfonthead, "RESIDENTIAL CONSTRUCTION", width = tw,
>> height = th)
>>
>> // tw is now 299 – way too big – should be about 216 or so…
>>
>> integer mtw
>> mtw = tw/app.form.currentdpi * 25400 ;// to convert to mm
>>
>> // then I use mtw to specify a printwidth on a printform1
>>
>> Any ideas on how to make it more accurate?
>
> The result is the value in pixels. Any conversion assumes a direct relationship with a printout, which is not the case.
>
> Ciao, NeilOk so how do you estimate how much space a paragraph of text will take
up on paper with a specified font and point size? I have many comment
boxes that need to be printed as part of reports and they could be a
single word, sentence or many paragraphs. I need to know if they will
fit on the page I'm currently printing or I need to break the field and
print what doesn't fit on the next page.I'm using printform1 for reports.
Jean
Jean ValleeParticipantApparently the IDE didn't like the numbering scheme I was using for
printform1line controls. I was trying to keep track the # of lines and
text separately for debugging purposes.As soon as I went back and just used a straight number series
(STR(VAL(pname,ns)+1,"000000",ns) for all printnames, it worked fine.Jean Vallee
Jean ValleeParticipantThanks Ian! I'm not sure I would have ever figured that out! and it's
hello:-)Jean ValleeParticipantOn 4/8/2013 2:16 PM, Neil Robinson wrote:
> On 05/04/2013 18:45, JV wrote:
>> Trying to use printform1.selectkey but am getting an error 16 – wrong type.
>>
>> It only has 4 parameters but I've had no success trying to determine
>> which one it's complaining about.
>>
>> dring datasrc
>> datasrc =@ app.datasources
>> integer e; e = 0
>>
>> printform1 pf
>>
>> pf =@ openprintform1("bldgform.sxp", defpagewidth = 215900,
>> defpageheight = 279400, defnumberformat = "999999.00",
>> defdateformat = "mm/0d/yyyy", deftimeformat = "hh:mm", datelocale = ds,
>> numericlocale = ns, datasources = datasrc, error = e)
>>
>> anyvalue pn
>> pn = me!PrmtTnum.control.text
>>
>> type(db1index)pfi
>> pfi =@ setidx_PrmtTNum(appw)
>>
>> app.bFound = .false
>> // no errors to here
>>
>> // this statement raises the error 16
>> pf =@ pf.selectkey(pn, pfi, found=app.bFound, e)
>
> You are attempting to assign the dataform1record object to a printform1 variable. This was probably not what you intended.
>
>> Both pn and pfi are valid objects of the correct type so what else could
>> it be?
>
> It is the return value where the type error is occurring.
>
> Ciao, Neil
>
Yes it was. I want the printform to select the record displayed in the
dataform1 and print it.
If I cannot assign the value of a dataform1 object to a printform1
variable via an anyvalue type variable, what can I use instead?Jean ValleeParticipantOn 4/8/2013 11:14 AM, kromkowski wrote:
>
> I've just started getting errors like this.
>
> Error in statement: end function
> Error: 'end function' reached within if or while block.
>
> Error in statement: function AddDates(wxmenuitem me,type(application) app)
> Error: Invalid characters found in local variable list – '('.
>
>
> But my AddDates function is completely empty. See below.
>
>
>
> function AddDates(wxmenuitem me,type(application) app)
> end functionThe IDE is not being accurate.. to say the least. That message could
actually be referring to code above it. or you're missing an end
function somewhere else.Been down this road many times. have learned to compile frequently so I
can keep track of what I've changed/added. When I get errors like that,
it's usually in what I just wrote even though the error refers to a
perfectly good function.also a gotcha.. if you use the Find in project and but click in the code
window, you will inadvertently put in garbage before you realize you're
not typing in the input box.Jean Vallee
Jean ValleeParticipantOn 3/28/2013 3:26 PM, JV wrote:
> No matter what I try printform1.selectkey is giving me fits.
>
> boolean ok; ok = .false
> integer e; e = 0
> printform1 pf
> pf =@ openprintform1(filename)
> type(db1index)i
> i =@ setidx_PrmtTnum(appw) ;// this is a string index
> string mystring
> mystring = "E-08-000003" ;// a known record in the index above
> // all ok to here
> pf.selectkey(mystring, i, found = ok, error=e)
>
> At this point I am getting both an error 16 and ok = .false and no record.
>
> I do get a record if I say pf.selectfirst or pf.selectlast
>
> What am I missing?
>
> Jean Vallee
>
>
Fit resolved.. Not opening the file I thought I was.But now have a different problem
Open files with appframework, then do.
prinform1
pf =@ openprintform1(filename)and get an error 3, locked out.
Since printform1 is not part of appw, is this trying to open the table a
second time like a second user?Jean
Jean ValleeParticipantOn 3/21/2013 2:56 PM, Neil Robinson wrote:
> On 21/03/2013 17:37, JV wrote:
>> Any way to make the option button itself bigger?
>> It does not scale with the font size..
>> Jean
>>
>
> No, it is a Windows control and the size look, etc. is dependent on the OS settings, theme, etc.
>
> Ciao, NeilBummer!
Jean ValleeParticipantOn 3/20/2013 12:44 PM, Neil Robinson wrote:
> On 20/03/2013 16:10, JV wrote:
>> I have a dataform1 opened with preventfocus = true.
>>
>> User clicks an Edit Record button
>>
>> At this point masterrecord.isdirty is false.
>>
>> I do selectcurrent(lock = .true) and masterrecord.isdirty is now true.
>>
>> The record has not been modified but checkneedsave will think it has
>> been because isdirty is true.
>>
>> Any way to defer setting isdirty to true to when they actually do make a
>> change and not if they just click edit and look at the record?
>>
>> Jean Vallee
>>
>
> It looks like the code is there to do exactly that, and I vaguely remember we had issues that cropped up, which is perhaps why now
> the dirty state is set whenever you lock. We can have a look at it, and see if perhaps that can be altered to not set isdirty to
> .true unless the user changes something. If you change something programmatically, you will still need to call setdirtystate()
> expressly.
>
> Ciao, NeilIf this is the way it will stay, I will have to write many functions to
find the stored record and compare each editable control to the stored
values. If any don't match, then my isdirtyvar would be set to true.Lot of extra work…
But this will absolutely be needed when the user finds a record, clicks
edit but doesn't do anything but look at it.. a very common occurrence
cuz they get interrupted. Ideally they would use the inquiry form but
they don't know they'll be interrupted…Jean ValleeParticipantOn 3/19/2013 4:18 PM, Neil Robinson wrote:
> On 13/03/2013 21:19, JV wrote:
>> I get these sporadically
>>
>> plv_application app
>> app =@ appw.app
>> dataform1 me
>> me =@ appw.form
>> integer e ; e = 0
>> boolean ok ; ok = .true
>> type(dataform1control)fc ;// this always works
>> fc =@ me.findcontrol("SubDivCode") ;// can find it
>> // another example of not finding me!
>> // if me!SubDivCode == "" ;// but this doesn't always work
>> if fc.control.text == "" ;// so I do this
>> ok =@ SelPrmtSubDivOK(appw)
>> end if
>>
>> Any ideas?
>> Jean
>>
>
> Not really, since both of them use the same method of getting to the control, which is to look it up by name in the controlarray.
> The control names are case-sensitive though, so that could be the problem.
>
> Ciao, NeilI learned my lesson on case sensitivity (hard lesson but I did learn
it…) so I know that is not the problem. I've started using
dataform1control / me.findcontrol everywhere since I know it works.The error I get is 200 if that helps.
- AuthorPosts