Hi,
I have code defined as follows (it's a fpGUI Toolkit project). Here I have a Form with 2 Buttons on it. No event handlers have been defined yet.
TMainForm = class(TfpgForm)
private
MainForm}
btnCreate: TfpgButton;
btnDebug: TfpgButton;
MainForm}
public
procedure AfterCreate; override;
end;Inside the AfterCreate() method is the code that initializes the GUI. fpGUI doesn't use external *.lfm files like Lazarus LCL projects.
Anyway, I add a OnClick event handler in the AfterCreate method for one of the buttons.
btnDebug := TfpgButton.Create(self);
with btnDebug do
begin
...
OnClick := | // | is the cursor position
end;I then press Ctrl+Shift+C to fire off code completion which creates the event handler. This is the result:
TMainForm = class(TfpgForm)
procedure btnDebugClick(Sender: TObject);
private
MainForm}
btnCreate: TfpgButton;
btnDebug: TfpgButton;
MainForm}
public
procedure AfterCreate; override;
end;But that is not really what I wanted. I wanted the btnDebugClick method to be private, not published. Published is the default visibility if no visibility is specified. The following code is actually what I wanted:
TMainForm = class(TfpgForm)
private
MainForm}
btnCreate: TfpgButton;
btnDebug: TfpgButton;
MainForm}
procedure btnDebugClick(Sender: TObject);
procedure btnCreateClick(Sender: TObject);
public
procedure AfterCreate; override;
end;Is there any way I can tune my Code Completion to do this? If so, what settings must I change? Or is that something hard-coded into Code Completion that cannot be changed?
Even after I manually moved the btnDebugClick() event handler to the correct location in the 'private' area, when I create the second event handler for the Create Button, Code Tools again places the event handler in the published section.
In Code Tools I have "Class part insert policy" set to "Last" and "Method insert policy" set to "class order".
Regards,
- Graeme -
_______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/
