CW2.0 Changing a tabs properties before selected PROBLEM 
Author Message
 CW2.0 Changing a tabs properties before selected PROBLEM

Hi folks,

in a sheet with three tabs I want to change the
color of the caption when selected to emphasize
which tab is concerned.

+-------+-------+-------+
| white | black | black |
|       +---------------+
|                       |

Tab one is selected.

Since there's no EVENT:selected for tabs (opposite
to what's stated in the manuals) I took the
EVENT:TabChanging and put in code like this:

case NumberOfSelectedTab
 of 1
  ?Tab1{prop:fontcolor}=color:white     ! selected
  ?Tab2{prop:fontcolor}=color:black
  ?Tab3{prop:fontcolor}=color:black
  do ChangeColorOfSub                   ! read on
 of 2
  ?Tab1{prop:fontcolor}=color:black
  ?Tab2{prop:fontcolor}=color:white     ! selected
  ?Tab3{prop:fontcolor}=color:black
 of 3
  ?Tab1{prop:fontcolor}=color:black
  ?Tab2{prop:fontcolor}=color:black
  ?Tab3{prop:fontcolor}=color:white     ! selected
end

Very very strange things are happening: The colors
are set just viceversa! The selected tab is black,
the others are white. I traced the code using the
de{*filter*}; the correct case section is processed but
nevertheless the colors are set viceversa.

The horror continues...

I have another sheet on the first tab (kind of a
subset of tabs) containing five tabs. I wanted to
do the same for these. The color change is done by
a ROUTINE named ChangeColorOfSub. The code looks
similar. Basically the same behaviour appears. But
when I change to the second 'main' tab and back to
the first (ChangeColorOfSub is executed), the
colors of the sub-tabs are set correctly at first.
Unless I again select a tab on the subset; in this
case the colors are again being set viceversa.

I added buttons to the window which call the ROUTINE
directly; this time nothing happens at all, no color
change is done.

That leads to the following conclusions:
1. the tab losing focus is subject to change
2. the tab gaining focus is subject to change
3. all other tabs are not being changed at all until
   selected

There's a need to have EVENT:LoseFocus and
EVENT:GainFocus for tabs...

HELP!!!

All suggestions are really appreciated to prevent
the following code from executing:

Rakloedder{PROP:BlinkingCrazy}=on



Sun, 28 Mar 1999 03:00:00 GMT  
 CW2.0 Changing a tabs properties before selected PROBLEM

Hi

We have template that will do all this for you.
You can get demos of this from our web site at www.c3dev.com

HTH
Bruce

Quote:
>Hi folks,
>in a sheet with three tabs I want to change the
>color of the caption when selected to emphasize
>which tab is concerned.
>+-------+-------+-------+
>| white | black | black |
>|       +---------------+
>|                       |
>Tab one is selected.
>Since there's no EVENT:selected for tabs (opposite
>to what's stated in the manuals) I took the
>EVENT:TabChanging and put in code like this:
>case NumberOfSelectedTab
> of 1
>  ?Tab1{prop:fontcolor}=color:white ! selected
>  ?Tab2{prop:fontcolor}=color:black
>  ?Tab3{prop:fontcolor}=color:black
>  do ChangeColorOfSub                       ! read on
> of 2
>  ?Tab1{prop:fontcolor}=color:black
>  ?Tab2{prop:fontcolor}=color:white ! selected
>  ?Tab3{prop:fontcolor}=color:black
> of 3
>  ?Tab1{prop:fontcolor}=color:black
>  ?Tab2{prop:fontcolor}=color:black
>  ?Tab3{prop:fontcolor}=color:white ! selected
>end
>Very very strange things are happening: The colors
>are set just viceversa! The selected tab is black,
>the others are white. I traced the code using the
>de{*filter*}; the correct case section is processed but
>nevertheless the colors are set viceversa.
>The horror continues...
>I have another sheet on the first tab (kind of a
>subset of tabs) containing five tabs. I wanted to
>do the same for these. The color change is done by
>a ROUTINE named ChangeColorOfSub. The code looks
>similar. Basically the same behaviour appears. But
>when I change to the second 'main' tab and back to
>the first (ChangeColorOfSub is executed), the
>colors of the sub-tabs are set correctly at first.
>Unless I again select a tab on the subset; in this
>case the colors are again being set viceversa.
>I added buttons to the window which call the ROUTINE
>directly; this time nothing happens at all, no color
>change is done.
>That leads to the following conclusions:
>1. the tab losing focus is subject to change
>2. the tab gaining focus is subject to change
>3. all other tabs are not being changed at all until
>   selected
>There's a need to have EVENT:LoseFocus and
>EVENT:GainFocus for tabs...
>HELP!!!
>All suggestions are really appreciated to prevent
>the following code from executing:
>Rakloedder{PROP:BlinkingCrazy}=on

Bruce Wojak C3 Development Inc
708 923 9999   fax 708 923 0207 BBS 708 923 0206

Web site  www.c3dev.com


Sun, 28 Mar 1999 03:00:00 GMT  
 CW2.0 Changing a tabs properties before selected PROBLEM

Quote:


>schreibt:
>>We have template that will do all this for you.
>>You can get demos of this from our web site at www.c3dev.com

>>HTH
>>Bruce
>Bruce, I found a much cheaper way: in the NewSelection event of the sheet
>you only need to retrieve the tab number being selected (CHOICE) and
>change
>the colors depending on it.
>Sorry if I thwart your business :)

Yes, but it seems to me your problem is caused by what the slected tab
is at the different embed points.  I think you'll find that the value
returned by CHOICE is for the tab you are moving FROM in the
TabChanging and NewSelection embed points, and for the tab you are
moving TO in the Accepted embed point for the sheet.
However, I was just dealing with this the other day, and I didn't seem
to be getting to the Accepted embed point at all. (Now I didn't really
try very hard, because I only had two tabs, so I could just as easily
fix my code on which tab you were moving FROM).  Don't like to spend
too much time in the de{*filter*}.  Life is too short...<g>
----------------------
Jon Waterhouse
Andy Rowe Consultants,
St. John's NF


Sun, 28 Mar 1999 03:00:00 GMT  
 CW2.0 Changing a tabs properties before selected PROBLEM


schreibt:

Quote:
>We have template that will do all this for you.
>You can get demos of this from our web site at www.c3dev.com

>HTH
>Bruce

Bruce, I found a much cheaper way: in the NewSelection event of the sheet
you only need to retrieve the tab number being selected (CHOICE) and
change
the colors depending on it.

Sorry if I thwart your business :)



Sun, 28 Mar 1999 03:00:00 GMT  
 CW2.0 Changing a tabs properties before selected PROBLEM

Quote:


>schreibt:
>>We have template that will do all this for you.
>>You can get demos of this from our web site at www.c3dev.com

>>HTH
>>Bruce
>Bruce, I found a much cheaper way: in the NewSelection event of the sheet
>you only need to retrieve the tab number being selected (CHOICE) and
>change
>the colors depending on it.
>Sorry if I thwart your business :)

Nope..
no problem <g>

Bruce Wojak C3 Development Inc
708 923 9999   fax 708 923 0207 BBS 708 923 0206

Web site  www.c3dev.com



Mon, 29 Mar 1999 03:00:00 GMT  
 CW2.0 Changing a tabs properties before selected PROBLEM


Waterhouse: Andy Rowe Consultants) schreibt:

Quote:
>Yes, but it seems to me your problem is caused by what the slected tab
>is at the different embed points.  I think you'll find that the value
>returned by CHOICE is for the tab you are moving FROM in the
>TabChanging and NewSelection embed points, and for the tab you are
>moving TO in the Accepted embed point for the sheet.
>However, I was just dealing with this the other day, and I didn't seem
>to be getting to the Accepted embed point at all. (Now I didn't really
>try very hard, because I only had two tabs, so I could just as easily
>fix my code on which tab you were moving FROM).  Don't like to spend
>too much time in the de{*filter*}.  Life is too short...<g>

Well, it's not a problem anymore. I agree, the EVENT:Accepted seems never
to be generated. Actually I don't use CHOICE to determine the selected tab
but set up the sheets USE to fill a variable. Then I filled the
EVENT:NewSelection
embed with the appropriate code to change the colors depending on that
variable. I really don't know why but it works now.


Tue, 30 Mar 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. CW2.0 Cannot change tab order PROBLEM

2. CW2.003 - changing font properties in a report

3. To change the first selected tab on a sheet CW

4. Selecting TAB sheet by pressing TAB key

5. CW2.0 Size of tab-caption doesn't fit to font PROBLEM

6. CW2.0 Additional Tab positioning PROBLEM

7. Group key not working to select record(s) problem CW2.003

8. CW2.003 File copy changes the date.....need a way to copy w/o date change

9. How to change Record Filter when changing Tab

10. CW2.003 - Printing Properties question..

11. CW2.0 Property list???

12. (VSE) - Version tab for an exe properties page..

 

 
Powered by phpBB® Forum Software