- This topic has 9 replies, 2 voices, and was last updated 12 years, 10 months ago by Support.
-
AuthorPosts
-
December 19, 2011 at 5:59 am #34960pholonParticipant
add a property when close a tabsheet on TsPageControl, please.
TsPageControl.onCLoseActivePage
or TsPageControl.OnClosePage(tabsheet)
December 19, 2011 at 8:26 am #47416SupportKeymasterWhen this event should be called in the component?
December 20, 2011 at 6:11 am #47419pholonParticipantI want to free some memory when TsPageControl closing one tabsheet.
Can TsPageControl add a method “CloseActivePage”?
December 20, 2011 at 6:12 am #47427pholonParticipantJust like tms.advPageCoutrol : OnCloseActivePage, CloseActivePage Method and so on.
December 20, 2011 at 6:33 am #47428pholonParticipantsPageControl.pas
procedure TsPageControl.WndProc(var Message: TMessage);
WM_LBUTTONUP, WM_LBUTTONDOWN:
if Assigned(OnCloseBtnClick) then OnCloseBtnClick(Self, i, b, Act);
and
procedure TsPageControl.CloseClick(Sender: TObject);
if Assigned(OnCloseBtnClick) then OnCloseBtnClick(Self, TsTabBtn(Sender).Page.TabIndex, ToClose, Act);
OnCloseBtnClose Renamed OnClosePage, More appropriate.
if you add a method closePage(iIndex : Integer) to closing the, Just like TsPageControl.CloseClick. it More convenient.
sorry my bad english.
thanks
December 20, 2011 at 10:27 am #47435SupportKeymasterClosed page may be destroyed or just hidden,
How you think, this event should be called in both cases?
December 21, 2011 at 2:41 am #47445pholonParticipantthere is a menuitem with caption “CloseAllTabSheets” in mainmenu.
if this menuitem clicked then calling the method :
//code
procedure OnCloseAllTabsheets;
begin
while sPageControl1.PageCount 0 do
begin
sPageControl1.ActivePageIndex := 0;
try
sPageControl1.CloseActivePage; //!!!!!!! need this method or : sPageControl1.ClosePage(aPageIndex : Integer);
if iPageCount = sPageControl1.PageCount then //close error
Break;
except
on E : Exception do
begin
MessageBox(Handle, Pchar(E.Message), 'OK', MB_OK);
Break;
end;
end;
end;
end;
//code
thanks!
December 26, 2011 at 8:34 am #47461SupportKeymaster'pholon' wrote:there is a menuitem with caption “CloseAllTabSheets” in mainmenu.
if this menuitem clicked then calling the method :
//code
procedure OnCloseAllTabsheets;
begin
while sPageControl1.PageCount 0 do
begin
sPageControl1.ActivePageIndex := 0;
try
sPageControl1.CloseActivePage; //!!!!!!! need this method or : sPageControl1.ClosePage(aPageIndex : Integer);
if iPageCount = sPageControl1.PageCount then //close error
Break;
…….
So, an event is not needed? You want to have a procedure for a pages closing??
December 27, 2011 at 1:14 am #47471pholonParticipantyes, I want to have a procedure for a pages closing. and when closing, calling OnCloseBtnClose
January 12, 2012 at 10:09 am #47520SupportKeymasterBut why you can't use standard ways for a page closing?
I will think about adding the OnClosePage event.
-
AuthorPosts
- You must be logged in to reply to this topic.