[futurebasic] RE: [FB] window path proxy icon [was: what is that called]

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2003 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Mon, 20 Oct 2003 21:09:42 -0400
 
You must have read my mind.  Thank you for all your help.
Now allow me to help in my own small way.

Instead of using ev.what = 0 use %event,0
I know they SHOULD do the same thing but whenever I need to clear an event I
use %event,0 as I have found ev.what and eventRecPtr&.evtNum% = _nullEvt to
not always be reliable.

One day I would like to really know why it always works when other methods
do not.

I tested this many times and there was no jumping when using %event,0


Thanks again,


W.

-----Original Message-----
From: Robert Purves
To: futurebasic@...
Sent: 10/19/03 6:40 PM
Subject: [FB] window path proxy icon [was: what is that called]


On Friday, October 17, 2003, Robert Purves wrote:
> On Friday, October 17, 2003, Edwards, Waverly wrote:
>> I was interested in the feature where you click on an icon in the 
>> finder
>> window and it shows you the path of a file.
>
> '~'A
> '                       Runtime : Rntm Appearance.Incl
> '                           CPU : Carbon
> '~'B
>
> include "Tlbx CarbonEvents.incl"
>
> dim as OSStatus  err
> dim as FSSpec    fss
>
> long if ( files$( _FSSpecOpen,,, fss ) != "" )
> appearance window 1, fss.name,, _kDocumentWindowClass, ¬
>   _kWindowStandardHandlerAttribute
> err = fn SetWindowProxyFSSpec( window( _wndRef ), fss )
> print "Command click the title"
> do
> HandleEvents
> until 0
> end if


The demo posted above used _kWindowStandardHandlerAttribute. As a basis 
for exploration, here's a version based on a window with ordinary FB 
event handling. It has at least one bug: after selecting a path folder 
in the pop-up menu, if you click back on the FB window it jumps into a 
new position.


local mode
local fn DoEvent
'~'1
dim as EventRecord   ev
dim as WindowRef   @ evntWnd
dim as OSStatus      ignore
dim as long        @ ignoreMenuResult

ev = event
long if ( ev.what == _mButDwnEvt )
select fn FindWindow( #ev.where, @evntWnd )
case _inProxyIcon, _inDrag
long if ( fn IsWindowPathSelectClick( evntWnd, #ev ) )
ignore = fn WindowPathSelect( evntWnd, 0, @ignoreMenuResult )
ev.what = 0
end if
end select
end if
end fn

dim as OSStatus  err
dim as FSSpec    fss

on event fn DoEvent
long if ( files$( _FSSpecOpen,,, fss ) != "" )
window 1, fss.name
err = fn SetWindowProxyFSSpec( window( _wndRef ), fss )
print "Command click the title"
do
HandleEvents
until 0
end if


--
To unsubscribe, send ANY message to
<futurebasic-unsubscribe@...>