Jump to content


Photo

fix for a bug in pagecontrol OnCloseClick


  • Please log in to reply
23 replies to this topic

#21 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 16 February 2007 - 01:12 AM

i really dont understand how it works for u
im sure we miss sth here

what happen on my compuer is, that after the page is deleted (not removed)
there is no new activepage (see in code nothing is setting a new activepage)
so the page is deleted but the tab is physically still there.
if i manually click on another tab (setting a new active page)
the tab disappears.
if instead i alt+tab back and forth i get what u saw in the image i put here
(ghost page), again, until i manually selects a new tab

if i simply do the following:
if Accept then
begin
DeletePage(ActivePage);
if pageCount > 0 then
ActivePageIndex := 0; <-- addition of this line
end;
then it works, bcoz a new activepage is set so the ghost page is not there anymore

and once again, i dont understand the difference between deletepage and removepage
and why deletepage is used for when i click on the X to close a page

#22 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 16 February 2007 - 09:45 AM

Hi,

QUOTE (emailaya @ Feb 16 2007, 01:12 AM) <{POST_SNAPBACK}>
and once again, i dont understand the difference between deletepage and removepage
and why deletepage is used for when i click on the X to close a page


Mail me a little demo project and i'll look at it if it has the same effect at my developing machines.
G.W. van der Vegt

#23 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 16 February 2007 - 04:24 PM

i have made a simple demo
a button to create pages (at runtime) and the X to close them
i made some pages and clicked the X

i put a breakpoint in
procedure TNxNotebook.Notification(AComponent: TComponent; Operation: TOperation);

and in the simple demo, it did stop there for the tabsheet i just closed and the first page was set as active - works ok

in my app, inside the main page (to be deleted) i have a form with some more pagecontrols. when closing the main page, i setup a dialog asking "are you sure" and accept if yes. this time, the breakpoint above stopped ONLY for the pages that are inside the form that is inside the main page
it DIDNT stop for the main page i actually deleted.

i dont know how to check why it didnt stop ofcourse smile.gif
please advice

#24 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 23 February 2007 - 02:33 AM

i still seems to have the above problem with the new pre-release version




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users