Jump to content


Photo

OnChange event for TnxPageControl


  • Please log in to reply
16 replies to this topic

#1 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 18 November 2006 - 01:56 PM

hi

some issues about nxPageControl:

1) when the main form is created i have several pagecontrol components
on one of them i have a TnxTabSheet - from designtime

the OnChange event of the TnxPageControl is triggered in the above case
even b4 the FormCreate event is triggered

it wasnt like that in the previous version

2) Scrollers are still enabled even when they are not needed (tabs are not overflowed)
the current situation is very confusing, the user clicks on them but nothing happens

3) ScrollMethod: was commented out, why? how can i tell the pagecontrol that each click will show fully the next invisible tab?

4) i have a pagecontrol inside a pagecontrol. in the inside pagecontrol i have a listview which parent tab is set according to a variable
if i call the inside pagecontrolChange event manually (after settings the .activepageindex) the listview is not shown though the parent and visible properties are ok. if i click on another tab in the inside pagecontrol (pagecontrolChange event is triggered automatically), then the listview is shown ok
edited: it seems that if the new ActivePageIndex is the same as now (no change) OnChange event is triggered but the content of that page is not refreshed so the content is not visible (though the visible property is true)

thanks

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 18 November 2006 - 03:36 PM

Hello,

1) Open NxPageControl.pas and find:

procedure TNxNotebook.SetActivePage(const Value: TNxTabSheet);

replace last line into:

CODE
  if not(csLoading in ComponentState) then DoChange; { event }


2) This will be changed soon.

3) Work is still in progress for this property.

4) Can you please give me some small sample to I test it. Thank you.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 18 November 2006 - 03:50 PM

1) solved, thanks

2) in the next release? is there a quickfix for this until then?

3) is there a quick fix for this, until it will be part of the release?

4) TNxNotebook.SetActivePage line 2: if (Value = FActivePage) then Exit
if i omit this line it works, bcoz then all the refresh and inside processing is executed. otherwise, even if OnChange event is triggered manually, it doesnt affect the content if it was set inside the OnChange event (at runtime)

5) tabfont - works perfect - thanks

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 18 November 2006 - 04:01 PM

Hello,

2) I will add a quick fix. Anyway, I have a plan to release new files every few days.

3) I don't know right now

4) Can you please attach here one small sample app to I test. I don't know it is a good to comment line.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 18 November 2006 - 04:03 PM

2) i meant a quick fix, just like point 1 u gave me so i wont need to wait to the new release unless u tell me the new release is in the coming 2-3 days smile.gif
i want to release a new version of my application that's why i ask
if its not possible then its ok

3) ok, i hope it will be fixed soon

4) i will make a sample and put it here in a few minutes

#6 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 18 November 2006 - 04:23 PM

hi
attached sample

if line 2 as i mentioned b4 exists
clicking on the button - wont do anything
if line 2 is commented out, the listview changes place inside the nxtabsheet (page 0) as it should

anyway, if u manually click on one of the tabs (onchange event is triggered)
the listview changes place inside the selected tab

if the above is not clear, let me know

(edited: for some reason i cant add attachment: sample.rar
so here it is here: http://download.yous...181EF9C0592BABC

#7 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 19 November 2006 - 09:40 PM

did u get the sample application?
was it helpful?

is a new release with the issues that were left out in 3.9.5
will be release soon?

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 19 November 2006 - 10:45 PM

Hello Emailaya,

This bugs will be fixed, one by one smile.gif

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 20 November 2006 - 01:03 AM

apparently the solution i gave was not good enough
if i click on an already selected tab
the events (changing/change) are triggered again
a refresh is done as well

this should be think about more carefully then

#10 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 22 November 2006 - 12:32 AM

hi
please advice a quick fix (if there is ofcourse)
for the problem of choosing the same tab causing to refresh itself

that happen when i commented TNxNotebook.SetActivePage line 2: if (Value = FActivePage) then Exit that caused another problem smile.gif

thanks

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 22 November 2006 - 05:28 AM

Hello,

Problem is because current ActivePageIndex is already 0 (set in design-time) and, when you manualy set ActivePageIndex from code nothing is changed and OnChange event don't occur.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#12 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 22 November 2006 - 09:06 AM

right
but this problem didnt occur in version 3.9.4
sth was changed for version 3.9.5 that causes this

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 22 November 2006 - 03:59 PM

Hello,

This is because you have ask me to remowe OnChange event when adding new pages wink.gif This is a reason why OnChange now don't occur automatically.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#14 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 22 November 2006 - 04:55 PM

smile.gif
so how TPageControl behaves?
u dont have this problem
and the OnChange event is not triggered when u add a new page

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 22 November 2006 - 05:29 PM

Hello Emailaya,

Now, when you add new page OnChange don't occur. You need to manualy add listview into page.

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#16 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 22 November 2006 - 10:36 PM

onChange event shouldnt trigger when new page is added - that is correct

the thing is:
i have a listview in pagecontrol X
if i chose a certain tab in X
there is a pagecontrol Y (that is placed in that certain tab)
and the listview should now placed there (so i have to do it in runtime)
since the activepageindex of Y is 0 from designtime
when placing the listview there, the tab is not refreshed/invalidate or redrawn (whatever should be) so the listview is not visible on that tab
only manually clicking on another tab and back, making this listview visible (visible property is true from the begining)

after doing listview.parent := tab (in pagecontrol Y)
i did pagecontrol.refresh, and pagecontrol.refreshpage
i even tried tab.pagevisible := false and then tab.pagevisible := true
but nothing helped

plz advice
thanks

#17 emailaya

emailaya

    Master Member

  • Members
  • PipPipPipPipPip
  • 984 posts

Posted 23 November 2006 - 12:53 AM

ok
the solution is just set the activepageindex to sth else
and then back

that is just in case the new index is like the current activepageindex

the solution is a bit skew but it works




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users