Some delphi questions : changing the screen-layout run-time

Back to problems page - Back to homepage

 

I'm building a component that enables the user of our application to change the screen layout at run-time.

I've only 2 little problems left, who can help me ?

 

Question 1 :

Does anybody know a way to catch the form messages in an invisible component which is located on the form, so that we only need to put the component on the form ?

 

I know how I can capture all the form message at the form level.

procedure TForm1.WndProc(var Message: TMessage); // override in declaration

begin

// i can do some stuff here !

inherited WndProc(Message);

end;

 

but, i want to capture the message in an TComponent which is located on the form.

 

Question 2 :

Question, do you know a way to simulate the csDesigning component state.

In the Delphi form designer at designtime the controls don't proces the windows mouseclick, keypress events, but the user is still able to activate another tabsheet in a pagecontrol......

I've tried setting csDesigning at run-time but this doesn't work...

We need to disable most of the controls (except pagecontrol...) when the user starts redesigning the form.

For example. the user wants to move a button. In edit mode the onclick event should be disabled.

There a few solutions but they all have there limitations :

- Disabling all the events : onclick, onmousedown, onkeypress, onChange :

Problem : we need to create a routine for every main class like TButton, TLabel, TPanel, TDBLookupControl etc.......

and some (user made) components have something in the DoClick overridden method which can't be disabled with the onclick event.

- Set the enabled property of all the controls to false when in edit mode.

Problem : controls will look gray when disabled and we can't disable pagecontrols because the user must be able to put a control on another tabsheet.

 

send e-mail to [email protected]

Sign My Guestbook View My Guestbook