Re: FTC Proxy Problems

  • From: Jim Pitchford <jim@xxxxxxxxxxxxxxxx>
  • To: ftcdev@xxxxxxxxxxxxx
  • Date: Thu, 20 Jun 2013 07:55:52 -0500

Ah, found it at last.

I wasn't correctly detecting the presence of the right proxy in Mousedown, and 
further, returning false doesn't seem to trigger gotFocus.

So changed the mousedown event handler to:

  'if ftEditProxy = nil then return false
  if editIndex <> index or ftEditProxy = nil then me.SetFocus
  
  ' Invoke the event.
  return ftEditProxy.callMouseDown(x, y)
  
and all seems to work now.

Thanks for your help.

Jim Pitchford
jim@xxxxxxxxxxxxxxxx



On 19 Jun 2013, at 17:01, Jim Pitchford <jim@xxxxxxxxxxxxxxxx> wrote:

> Bob, Seth
> I have made some progress, thanks to your hints.
> 
> 1. Caret invisible required an update, as did the insertion point - both OK 
> now.
> 2. I think the issue here may have been related to trying to use the same 
> FTCProxy for calculating contents of both displayOnly pictures and editable 
> canvases. I have separated them in the linked file and I don't see the 
> problem anymore.
> 3. see 1.
> 4. see 2.
> 
> I've placed a demo file in 
> https://www.dropbox.com/sh/e0b02ulhh2tvxf7/xQEE5XsnLG
> 
> My remaining problems now seem to be:
> 5. I can't get the focus to move to a new canvas on a mouse click - only 
> cntrl Tab seems to move between the canvases.
> 6. I had hoped to use a single window class, held in 2 properties, for the 
> instances of wEditProxy and wDisplayProxy, but this causes all sorts of 
> problems on loading FTCProxy. So have had to resort to 2 separate window 
> classes, one for Edit, one for Display - which feels redundant. This is 
> relatively minor, just curious why doesn't work.
> 
> Grateful if you can look at it to see if can resolve issue 5.
> 
> Regards
> Jim Pitchford
> jim@xxxxxxxxxxxxxxxx
> 
> 
> 
> On 18 Jun 2013, at 20:08, Bob Keeney <bobk@xxxxxxxxxxx> wrote:
> 
>> You're talking pretty specific stuff.  I suggest starting small.  That way 
>> if you want to send me an example project I can problem help a bit more.
>> 
>> 1.  What happens if set it to ReadOnly first?  I know that will really make 
>> the Caret invisible.
>> 
>> 2.  A small project demonstrating this might be helpful.
>> 
>> 3.  I'm assuming you're really doing ftc.GetDoc.moveinsertionpointto end?  
>> Have you done a full update at this point?
>> 
>> 4.  Again, I'm wondering if this is before or after you're readjusting the 
>> document/page size and after a full update?
>> 
>> Seth and I are happy to help as it might reveal some bugs we weren't aware 
>> of.  A small sample project would make that a LOT easier.
>> 
>> Bob Keeney
>> BKeeney Software Inc.
>> http://www.bkeeney.com
>> 
>> On Jun 18, 2013, at 6:06 PM, Jim Pitchford <jim@xxxxxxxxxxxxxxxx> wrote:
>> 
>>> Bob et al
>>> 
>>> I am still in the process of trying to use FTC in an app to replace 
>>> multiple text boxes, but continue to struggle.
>>> 
>>> Following Bob's advice I am trying to use FTCProxy in a single hidden 
>>> window, wFTCProxy.
>>> 
>>> On MouseEnter into a canvas I create a new FTCProxy via
>>> 
>>> targetProxy = new FTCProxy( CanvasX, wFTCProxy.target) 
>>> 
>>> and use that as the targetProxy for all actions within that canvas.
>>> 
>>> Prior to creating the new targetProxy, if a previous proxy exists I clear 
>>> any selections in that proxy so that they don't reappear in the new proxy 
>>> and set the targetProxy to nil.
>>> 
>>> I also use targetProxy.ftc.getDisplayPicture to grab a picture of the 
>>> targetProxy to display in CanvasX.paint when the mouse is not in the Canvas.
>>> 
>>> Thus, in theory, I end up with one hidden window to provide an FTC control 
>>> on demand.
>>> 
>>> My challenges are now:
>>> 
>>> 1. When taking the picture via getDisplayPicture - it also grabs the Caret 
>>> if it is blinking on at the time of the grab. Use of 
>>> ftc.blinkCaret(true/false) doesn't seem to be able to turn the caret on or 
>>> off.
>>> 
>>> 2. When moving into the editor - i.e. a new FTCProxy has been created, I 
>>> often get a bleed of the previous canvas' picture showing through the right 
>>> and bottom 2 pixels of the canvas being edited, even though both the canvas 
>>> and the targetProxy.target have been set to the same size.
>>> 
>>> 3. I seem to be unable to get the insertion point to move to the end of the 
>>> current text using ftc.moveInsertionPointToEnd(true) - the insertion point 
>>> stays religiously at the beginning.
>>> 
>>> 4. I need to re-adjust the size of the canvas to match the current height 
>>> of the text using dim newHeight as double = 
>>> Target.getdoc.getTotalPageLength. This works if I stay within one 
>>> canvas/proxy, but if I move to a new canvas, it seems to reflect the height 
>>> of the previous proxy, even though I issue a targetProxy.update(true) after 
>>> the targetProxy.ftc.setText ("text").
>>> 
>>> Note that all the above are in ftc.setEditMode.
>>> 
>>> Any pointers you might have in solving these issues would be gratefully 
>>> received.
>>> 
>>> Regards
>>> 
>>> Jim Pitchford
>>> jim@xxxxxxxxxxxxxxxx
>>> 
>>> 
>>> 
>>> FTC Website: http://www.bkeeney.com/products/formatted-text-control
>>> Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
>>> List Archive: www.freelists.org/archives/ftcdev
>>> Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" 
>>> in the subject field.
>>> 
>>> 
>> 
>> FTC Website: http://www.bkeeney.com/products/formatted-text-control
>> Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
>> List Archive: www.freelists.org/archives/ftcdev
>> Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" 
>> in the subject field.
>> 
>> 
>> 
> 
> 
> FTC Website: http://www.bkeeney.com/products/formatted-text-control
> Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
> List Archive: www.freelists.org/archives/ftcdev
> Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
> the subject field.
> 
> 
> 

FTC Website: http://www.bkeeney.com/products/formatted-text-control
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.


Other related posts: