Re: Subclassing from IDLitTool ?? [message #40705] |
Wed, 01 September 2004 10:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Christopher Lee writes:
> IDLitToolbase comes preloaded with all of the menus in the IDL
> standard iTools. IDLitTool comes with zero, nadda,
> zip. You have to supply all of the menu items (for example). Then
> IDLitTool contains the necessary functions to return the object
> references.
>
> e.g.
>
> ;Init method
> FUNCTION iprobe::Init
>
> if( self->IDLitTool::Init(_extra=_extra) eq 0)then $
> return, 0
> ;file
> self->RegisterOperation, 'Exit', 'IDLitopFileExit', $
> IDENTIFIER='File/Exit', /SEPARATOR
>
> ;button
> self->RegisterManipulator, 'Arrow', 'IDLitManipArrow', $
> ICON='arrow', /DEFAULT, IDENTIFIER="ARROW", $
> DESCRIPTION='Click to select items, click and drag to select multiple items'
>
> return, 1
>
> END
>
> That gets you onto the first step...
Didn't work for me. I get the same error as before. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Subclassing from IDLitTool ?? [message #40706 is a reply to message #40705] |
Wed, 01 September 2004 10:24   |
Chris Lee
Messages: 101 Registered: August 2003
|
Senior Member |
|
|
In article <4135CD89.4050300@est.fib.upc.es>, "Antonio Santiago"
<d6522117@est.fib.upc.es> wrote:
> What do i need to do to subclassing from IDLitTool? Thanks.
IDLitToolbase comes preloaded with all of the menus in the IDL
standard iTools. IDLitTool comes with zero, nadda,
zip. You have to supply all of the menu items (for example). Then
IDLitTool contains the necessary functions to return the object
references.
e.g.
;Init method
FUNCTION iprobe::Init
if( self->IDLitTool::Init(_extra=_extra) eq 0)then $
return, 0
;file
self->RegisterOperation, 'Exit', 'IDLitopFileExit', $
IDENTIFIER='File/Exit', /SEPARATOR
;button
self->RegisterManipulator, 'Arrow', 'IDLitManipArrow', $
ICON='arrow', /DEFAULT, IDENTIFIER="ARROW", $
DESCRIPTION='Click to select items, click and drag to select multiple items'
return, 1
END
That gets you onto the first step...
Chris.
|
|
|
|
Re: Subclassing from IDLitTool ?? [message #40840 is a reply to message #40706] |
Wed, 01 September 2004 23:30   |
Antonio Santiago
Messages: 201 Registered: February 2004
|
Senior Member |
|
|
Thanks floks :)
Ok both Christopher and David are right.
Now with IDL 6.0 Christopher'r code runs fine but not in IDL 6.1 (this
seems a joke) and yes, the documentation about IDLitTool is horrible.
Thanks and bye.
Christopher Lee wrote:
> In article <4135CD89.4050300@est.fib.upc.es>, "Antonio Santiago"
> <d6522117@est.fib.upc.es> wrote:
>
>
>
>> What do i need to do to subclassing from IDLitTool? Thanks.
>
>
> IDLitToolbase comes preloaded with all of the menus in the IDL
> standard iTools. IDLitTool comes with zero, nadda,
> zip. You have to supply all of the menu items (for example). Then
> IDLitTool contains the necessary functions to return the object
> references.
>
> e.g.
>
> ;Init method
> FUNCTION iprobe::Init
>
> if( self->IDLitTool::Init(_extra=_extra) eq 0)then $
> return, 0
> ;file
> self->RegisterOperation, 'Exit', 'IDLitopFileExit', $
> IDENTIFIER='File/Exit', /SEPARATOR
>
> ;button
> self->RegisterManipulator, 'Arrow', 'IDLitManipArrow', $
> ICON='arrow', /DEFAULT, IDENTIFIER="ARROW", $
> DESCRIPTION='Click to select items, click and drag to select multiple items'
>
> return, 1
>
> END
>
> That gets you onto the first step...
>
> Chris.
|
|
|
Re: Subclassing from IDLitTool ?? [message #40850 is a reply to message #40705] |
Wed, 01 September 2004 15:35   |
Chris Lee
Messages: 101 Registered: August 2003
|
Senior Member |
|
|
In article <MPG.1b9fb5c11558d7fc989873@news.frii.com>, "David Fanning"
<davidf@dfanning.com> wrote:
> Didn't work for me. I get the same error as before. :-( Cheers,
> David
I put the following code in a fresh file, compile the file, and then run the
IPROBE procedure, it works first time. You can even take out the 'file'
menu item. It still works for me. I'm not sure it's a bug, but you need
at least one manipulator/tool to start the iTool.
If that doesn't work, but the IDLitToolbase version works. Have a look
at the IDLitToolbase source. Strip the menus out of there until your left
with the minimum that will compile :)
As you said, this isn't possible with the information given in the
documentation.
{ x86 linux unix linux 6.0 Jun 27 2003 32 64}
Chris.
;start
FUNCTION iprobe::Init
if( self->IDLitTool::Init(_extra=_extra) eq 0)then $
return, 0
;file
self->RegisterOperation, 'Exit', 'IDLitopFileExit', $
IDENTIFIER='File/Exit', /SEPARATOR
;button
self->RegisterManipulator, 'Arrow', 'IDLitManipArrow', $
ICON='arrow', /DEFAULT, IDENTIFIER="ARROW", $
DESCRIPTION='Click to select items, click and drag to select multiple items'
return, 1
END
;Define object struct
PRO iprobe__define
struct = { iprobe, $
INHERITS IDLitTool $ ; Provides iTool interface
}
END
PRO iprobe
ITREGISTER, "Example iTool", "iprobe"
identifier = IDLITSYS_CREATETOOL("Example iTool")
END
|
|
|
Re: Subclassing from IDLitTool ?? [message #40922 is a reply to message #40706] |
Wed, 08 September 2004 09:35  |
Chris[2]
Messages: 39 Registered: August 2003
|
Member |
|
|
Hi Antonio & Chris,
There is a bug in framework/idlitcommandbuffer__define.pro, around line 232,
where it assumes that you have the Undo/Redo operations. You can work around
this by making sure the Undo/Redo operations are registered in your
subclass:
self->RegisterOperation, 'Undo', $
'IDLitopUndo', $
ACCELERATOR='Ctrl+Z', $
IDENTIFIER='Edit/Undo', ICON='undo', /disable, $
/IGNORE_AVAILABILITY
self->RegisterOperation, 'Redo', $
'IDLitopRedo', $
ACCELERATOR='Ctrl+Y', $
IDENTIFIER='Edit/Redo', ICON='redo',/disable, $
/IGNORE_AVAILABILITY
Or, if you are brave or don't want to have these operations, you can modify
idlitcommandbuffer__define.pro by adding a check after line 232:
change this:
oUndo = self._oEnv->GetByIdentifier('OPERATIONS/EDIT/UNDO')
idUndo = oUndo->GetFullIdentifier()
to the following:
oUndo = self._oEnv->GetByIdentifier('OPERATIONS/EDIT/UNDO')
if (~OBJ_VALID(oUndo)) then $
return
idUndo = oUndo->GetFullIdentifier()
-Chris
Research Systems, Inc.
"Christopher Lee" <cl@127.0.0.1> wrote in message
news:20040901.182404.1960709859.9943@buckley.atm.ox.ac.uk...
> In article <4135CD89.4050300@est.fib.upc.es>, "Antonio Santiago"
> <d6522117@est.fib.upc.es> wrote:
>
>
>> What do i need to do to subclassing from IDLitTool? Thanks.
>
> IDLitToolbase comes preloaded with all of the menus in the IDL
> standard iTools. IDLitTool comes with zero, nadda,
> zip. You have to supply all of the menu items (for example). Then
> IDLitTool contains the necessary functions to return the object
> references.
>
> e.g.
>
> ;Init method
> FUNCTION iprobe::Init
>
> if( self->IDLitTool::Init(_extra=_extra) eq 0)then $
> return, 0
> ;file
> self->RegisterOperation, 'Exit', 'IDLitopFileExit', $
> IDENTIFIER='File/Exit', /SEPARATOR
>
> ;button
> self->RegisterManipulator, 'Arrow', 'IDLitManipArrow', $
> ICON='arrow', /DEFAULT, IDENTIFIER="ARROW", $
> DESCRIPTION='Click to select items, click and drag to select
multiple items'
>
> return, 1
>
> END
>
> That gets you onto the first step...
>
> Chris.
|
|
|