Vanishing icon 
Author Message
 Vanishing icon

Hello,
I've got some serious icon trouble: a check box with an icon changes its
icon depending on the actually selected record in a browse (using the
NewSelection embed). This works fine - until the browse procedure calls
another window. After returning to the browse procedure no more icon is
displayed. The icons are linked into the dll. The code at the embed
point looks like:

if RecordValue            !hot field on list box
   ?CheckBox{prop:Icon} = '~icon1.ico'
else
   ?CheckBox{prop:Icon} = '~icon2.ico'
end
display()

Thanks,

Rainer Plischke
Just-EDV
[Clarion 2.003]



Sat, 18 Nov 2000 03:00:00 GMT  
 Vanishing icon

Quote:

>Hello,
>I've got some serious icon trouble: a check box with an icon changes its
>icon depending on the actually selected record in a browse (using the
>NewSelection embed). This works fine - until the browse procedure calls
>another window. After returning to the browse procedure no more icon is
>displayed. The icons are linked into the dll. The code at the embed
>point looks like:

>if RecordValue            !hot field on list box
>   ?CheckBox{prop:Icon} = '~icon1.ico'
>else
>   ?CheckBox{prop:Icon} = '~icon2.ico'
>end
>display()

Hi Rainer,

I have seen this behavior from time to time. Try setting an embed on
losing focus (for the original window) to reassign the icon and unhide
the checkbox. Maybe that will help

Good luck,
Steve
Legal Labs, Inc.



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Hi Steve,
thanks for your reply. I've tried the following (at the embed LoseFocus as
well as GainFocus, each single and both):

!unhide(?CheckBox)         !tried with and without it
?CheckBox{prop:icon} = '~icon1'
unhide(?CheckBox)

But it didn't work. So am I doing something wrong or are there other
solutions to this problem?

Rainer Plischke
Just-EDV
[Using Clarion 2.003.01]

Quote:

> I have seen this behavior from time to time. Try setting an embed on
> losing focus (for the original window) to reassign the icon and unhide
> the checkbox. Maybe that will help



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Quote:

>Hi Steve,
>thanks for your reply. I've tried the following (at the embed LoseFocus as
>well as GainFocus, each single and both):

>!unhide(?CheckBox)         !tried with and without it
>?CheckBox{prop:icon} = '~icon1'
>unhide(?CheckBox)

>But it didn't work. So am I doing something wrong or are there other
>solutions to this problem?

Hi Rainer,

The situations I have seen this in make me believe that too many
Windows resources are being used - (this may not be a CW
bug/limitation).. Boxes, icons, buttons and images are all subject to
this phenomenon. If you have "too many" of these things, this problem
can crop up

Good luck
Steve
Legal Labs, Inc.



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

If the second window called is in a different DLL then that's where your
problem lies. Clarion's resource pointers remain in the DLL/EXE which
opened the last window used, they do not return when that window is closed
unless you open a window in the calling DLL to reset the pointers. This has
been a problem since day one with CW.

Couple of ways to fix the problem....

1) add a simple window to your calling procedure or to the calling DLL and
then on return call that procedure to reset the pointers...

RestResource WINDOW
                      END

  CODE
  OPEN(RestResource)
  CLOSE(RestResource)
  RETURN

  ** this does not display the window since no ACCEPT is used

2) Include all your resources (ICO's, BMP's etc) in the called DLL.

Lee White
Team TopSpeed



Quote:
> Hello,
> I've got some serious icon trouble: a check box with an icon changes its
> icon depending on the actually selected record in a browse (using the
> NewSelection embed). This works fine - until the browse procedure calls
> another window. After returning to the browse procedure no more icon is
> displayed. The icons are linked into the dll. The code at the embed
> point looks like:



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Lee,
thanks! This helped - even if it means much dull work (including a lot of icons
into a lot of DLLs). That raises another question: is it possible to define
resources within one DLL and use the resources "external" from others? I'm
thinking of a graphics/icons-DLL. Or is this generally impossible or impossible
under Clarion?

Rainer Plischke
Just-EDV

Quote:

> If the second window called is in a different DLL then that's where your
> problem lies. Clarion's resource pointers remain in the DLL/EXE which
> opened the last window used, they do not return when that window is closed
> unless you open a window in the calling DLL to reset the pointers. This has
> been a problem since day one with CW.

> Couple of ways to fix the problem....

> 1) add a simple window to your calling procedure or to the calling DLL and
> then on return call that procedure to reset the pointers...

> RestResource WINDOW
>                       END

>   CODE
>   OPEN(RestResource)
>   CLOSE(RestResource)
>   RETURN

>   ** this does not display the window since no ACCEPT is used

> 2) Include all your resources (ICO's, BMP's etc) in the called DLL.



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Hi Rainer,


Quote:
>I've got some serious icon trouble: a check box with an icon changes its
>icon depending on the actually selected record in a browse (using the
>NewSelection embed). This works fine - until the browse procedure calls
>another window. After returning to the browse procedure no more icon is
>displayed. The icons are linked into the dll. The code at the embed
>point looks like:

You will most likely need to link the icons in both the dll's and the
exe.  The easiest way is to create a small prj file to be included:

icons.prj

#pragma link("1.ico")
#pragma link("2.ico")
#pragma link("3.ico")
#pragma link("4.ico")
... etc.

Best regards,

Arnor Baldvinsson        
[Team Topspeed - Internet Connect]
Allerup Edb
Denmark

http://www.icetips.com
UIN nr.: 2428601



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Quote:

>If the second window

 <good stuff snipped>

Thanks Lee!
That really explains the problem.

Steve
Legal Labs, Inc.



Mon, 20 Nov 2000 03:00:00 GMT  
 Vanishing icon

Arnor,
thanks. I didn't think of such a "simple" solution, but this will really help
(at least I hope so). One more question (just nice to know): is this a
Windows or a Clarion flaw?

Rainer Plischke
Just-EDV

Quote:

> You will most likely need to link the icons in both the dll's and the
> exe.  The easiest way is to create a small prj file to be included:

> icons.prj

> #pragma link("1.ico")
> #pragma link("2.ico")
> #pragma link("3.ico")
> #pragma link("4.ico")
> ... etc.



Tue, 21 Nov 2000 03:00:00 GMT  
 Vanishing icon

You can read icons from other files using PROP:Icon such as...

{PROP:Icon} = 'MyIcons.DLL[0]'  !reads 1st icon
{PROP:Icon} = 'MyIcons.DLL[1]'  !reads 2nd icon

This works for icons only.

Another option would be to include all related browses, forms, reports, etc
into the same DLL which prevents this pointer problem or, as I mentioned,
adding a simple procedure call whenever focus is regained to reset the
pointers.

Lee White
Team TopSpeed



Quote:
> Lee,
> thanks! This helped - even if it means much dull work (including a lot of
icons
> into a lot of DLLs). That raises another question: is it possible to
define
> resources within one DLL and use the resources "external" from others?
I'm
> thinking of a graphics/icons-DLL. Or is this generally impossible or
impossible
> under Clarion?

> Rainer Plischke
> Just-EDV



Tue, 21 Nov 2000 03:00:00 GMT  
 Vanishing icon

Lee,

That's what I was looking for, even if it is not very easy to use (which icon
is icon no 1, 2 and so on?). But this should be no prob after all. Thanx!

Rainer Plischke
Just-EDV

Quote:

> You can read icons from other files using PROP:Icon such as...

> {PROP:Icon} = 'MyIcons.DLL[0]'  !reads 1st icon
> {PROP:Icon} = 'MyIcons.DLL[1]'  !reads 2nd icon

> This works for icons only.



Fri, 24 Nov 2000 03:00:00 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. CW 2.0 and vanishing icons

2. ICONS, ICONS, ICONS....

3. ICONS, ICONS, ICONS

4. Icons Icons Icons

5. Black OS/2 icons and mini-icons for VisualWorks 2.0 for OS/2

6. cursor wait icon change to animated icon

7. CW2003 and multiple icon files / 16x16 icons works!

8. default icon / Re: Icon but no minimize ??

9. Own Icons in Clarion Icon- choice list

10. OS/2 icon to .ICON ea

11. OS/2 icon to .ICON ea.

12. ANNOUNCE: Icons 1.1 - Icon Library Package

 

 
Powered by phpBB® Forum Software