Re: [NTLK] Programming Question (protoLabelInputLine)

From: Michael J. Hußmann (michael_at_michael-hussmann.de)
Date: Thu Feb 12 2004 - 13:24:54 PST


Daedalus (daedalus_at_digitalinkwell.net) wrote:

> Any advice on how to let people enter text but still let an app be
> repositioned on the screen by the user? Maybe the viewClickScript I'm
> using above isn't the way to go?!?!

I would just choose a ProtoDragNGo as the base view and be done with it,
but in my earlier projects, I used a viewClickScript like this one:

func(unit)
begin
        local x := GetPoint(firstX, unit), y := GetPoint(firstY, unit);
        local box := self:GlobalBox();
        if y-box.top < 4 or box.bottom-y < 4 or x-box.left < 4 or box.right-x <
4 then
                begin
                        self:Drag(unit, nil);
                        self:Dirty();
                        return true
                end
        else return nil
end

The key is to make just the border draggable and leave the rest of the
view alone.

- Michael

Michael J. Hußmann

E-mail: michael_at_michael-hussmann.de
WWW (personal): http://michael-hussmann.de
WWW (professional): http://digicam-experts.de

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html
Official Newton FAQ: http://www.chuma.org/newton/faq/


This archive was generated by hypermail 2.1.5 : Thu Feb 12 2004 - 14:00:04 PST