Recent

Author Topic: Accessing event on another form triggers code completion error?  (Read 2446 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
I have set the Action of both a menu and a button to an ActionList item on a data module (meaning the event's code is in a different unit). Whenever I try to switch to the event's code I get one of these two messages depending on exactly what I wanted to do.

Code: [Select]
The component editor of class "TDefaultComponentEditor" has created the error:
"Unable to show method. Please fix the error shown in the message window, which is normally below the source editor."

Code: [Select]
Unable to show method. Please fix the error shown in the message window, which is normally below the source editor.
Is there a way around it or is it inherent to the IDE's design?

Lazarus 3.0/FPC 3.2.2

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Accessing event on another form triggers code completion error?
« Reply #1 on: April 25, 2015, 04:16:44 pm »
In your project's Project Option's dialog, click on the Paths page (under Compiler Options) and in the Other sources (.pp/.pas files...) edit box -it's the penultimate one on that page - add the path to the unit the IDE cannot find.

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Accessing event on another form triggers code completion error?
« Reply #2 on: April 25, 2015, 05:01:57 pm »
In your project's Project Option's dialog, click on the Paths page (under Compiler Options) and in the Other sources (.pp/.pas files...) edit box -it's the penultimate one on that page - add the path to the unit the IDE cannot find.

The unit one of the project's source files and ActnList is already in the files uses section.
Lazarus 3.0/FPC 3.2.2

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Accessing event on another form triggers code completion error?
« Reply #3 on: April 25, 2015, 05:14:43 pm »
Then what (codetools) error is shown in the Message window?

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Accessing event on another form triggers code completion error?
« Reply #4 on: April 26, 2015, 02:08:06 am »
Then what (codetools) error is shown in the Message window?

Code: [Select]
frmSwitchboard.pas(9,35) Error: identifier not found: actionOpenDesignerFormExecute
The Action List is on a data module named dmCentral, so the action is dmCentral.actionOpenDesignerForm, so the Execute action is actionOpenDesignerFormExecute. However in the object inspectior the OnExecute value is actionOpenDesignerFormExecute without the 'dmCentral.' prefix and it seems that the IDE is looking for the event on the form which contains the button, rather than the data module dmCentral that contains it.
Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018