thanks for the swift reply, and offer for help.
My problem is this :-
{our delphi snippet}
....
with StatusBar do
begin
// add the first panel ..
addpane(0);
// add the second
with addpane(ID_SB_CQ_1); ) do begin button := TRUE; end; // others
addpane(ID_SB_CQ_2); // date
addpane(ID_SB_CQ_3); // time
addpane(ID_SB_CQ_4); // user info
end
...
The problem is trying to "react" to the user click event when Pane id
ID_SB_CQ_1 is "clicked" by the user. As you can see setting the button property on means I want it to act like a button, and visually everything looks great
the problem is when the user clicks the button, I have no way of knowing this has happened!!!
IStatusBarEvents exists and has two events called:-
procedure PaneDblClick(const Pane: StatusBarPane); dispid 1;
procedure PaneClick(const Pane: StatusBarPane); dispid 2;
I should be able to declare my
OWN function and add the code below to "point" the event to mine, but I cannot do this does for some reason ("the bug/Flaw with Delphi" - as you can see in the VB snippet its easy to do for VB) :-
....
with StatusBar do
begin
// add the first panel ..
addpane(0);
// add the second
with addpane(ID_SB_CQ_1); ) do begin button := TRUE; PaneDblClick := MyPaneDblClick; end; // others
addpane(ID_SB_CQ_2); // date
addpane(ID_SB_CQ_3); // time
addpane(ID_SB_CQ_4); // user info
end
// Override and Catch/react to the user clicking on Pane 2
procedure MYOWNPaneDblClick(const Pane: StatusBarPane);
begin
showmessage('User clicked Status Panel 2');
end;
...
FYI and Example, with Codejock you can use the above concept for other things, like the Commandbar itself, they work perfectly :-
...
OutlookCmdBar := TCommandBarsFrame.Create(OnForm);
with OutlookCmdBar do
begin
Align := alTop; TabOrder := 1;
OnExecute := MyCommandBarsFrame1Execute;
OnResizeClient := MyCommandBarsFrame1ResizeClient;
visible := true; EnableOffice2007Frame(false);
end;
...
SO I HOPING
this is possible for the STATUSBAR AND for the message I logged on 15th March 2011 - same issue, different component.
thanks for your Help
Dave