NO

Author Topic: Little bug with resource controls id  (Read 10795 times)

alura

  • Guest
Little bug with resource controls id
« on: May 16, 2005, 09:44:58 AM »
First, thanks for free Pelles C.

I've manually imported a project from visual c to pellesc. No problem, but seem the starting control and object (dialog, icons etc) constant are different. This makes pelles c report an error when I try to rename e constant.

For example... my actual resource.h

#define IDI_SPEEDSYNC  8001
#define IDD_SPEEDSYNC  1001
#define IDD_ABOUTBOX  1002
#define IDD_DOJOB  1003
#define MAIN_ABOUT  1004
#define MAIN_JOBLIST 1005
#define JOBSEL  8002
#define IDI_JOBUNSEL  8004
#define IDI_JOBSEL  8005

If I create a new dialog, pellesc give automatically MAIN_ABOUT id, even if it is already associated to a button control.

If I try to rename MAIN_ABOUT dialog, giving a non existing constant name, for example IDD_TEST, the IDE report the error "The ID number 1004 is already used  by another symbol" that is correct but I'm expect that the dialog editor automaticalli assign a new constat to non existing simbols. If I rename the dialog to #1006 (that doesn't exist) than I can assign the IDD_TEST.

Hope that you understand my "basic" english... thank's again.

Marco

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Little bug with resource controls id
« Reply #1 on: May 17, 2005, 12:02:15 AM »
The resource editor expect all ID numbers to be unique, and will use certain ranges when assigning new ID numbers. It's hard to say from the description if it's a bug or not. I will have to look at some more first...

Pelle
/Pelle

alura

  • Guest
Little bug with resource controls id
« Reply #2 on: May 17, 2005, 12:20:32 PM »
Quote from: "Pelle"
The resource editor expect all ID numbers to be unique, and will use certain ranges when assigning new ID numbers. It's hard to say from the description if it's a bug or not. I will have to look at some more first...

Pelle


Use the attached project... then try to add a new dialog. A wrong constant is selected by default (should be MAIN_ADD that is a control). If you try to rename it (for example IDD_DEMO) you will see the error.

Also found another bug (imho). If you add a new icon, the resource editor modify an existing icon.

I've also problems with debugger. If you make a breakpoint anyware, you will have problems with auto and local variables watch (ie non variables listed).

Thank's.

Marco

JohnF

  • Guest
Little bug with resource controls id
« Reply #3 on: May 18, 2005, 11:13:11 AM »
Quote from: "alura"

I've also problems with debugger. If you make a breakpoint anyware, you will have problems with auto and local variables watch (ie non variables listed).


If you turn off optimisation all variables will be visible.

John

alura

  • Guest
Little bug with resource controls id
« Reply #4 on: May 18, 2005, 12:16:15 PM »
Quote from: "JohnF"
Quote from: "alura"

I've also problems with debugger. If you make a breakpoint anyware, you will have problems with auto and local variables watch (ie non variables listed).


If you turn off optimisation all variables will be visible.

John


Thank's john  :wink:

Anonymous

  • Guest
Little bug with resource controls id
« Reply #5 on: May 18, 2005, 02:33:53 PM »
Quote from: "JohnF"
Quote from: "alura"

I've also problems with debugger. If you make a breakpoint anyware, you will have problems with auto and local variables watch (ie non variables listed).


If you turn off optimisation all variables will be visible.

John


Thanks for this John....  I hadn't realized and was getting rather frustrated with the debugging tool.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Little bug with resource controls id
« Reply #6 on: May 18, 2005, 09:23:33 PM »
Quote from: "alura"
Use the attached project... then try to add a new dialog. A wrong constant is selected by default (should be MAIN_ADD that is a control). If you try to rename it (for example IDD_DEMO) you will see the error.

The IDE are currently using the following ranges:
1001 - 2000: dialogs
2001 - 3000: menus
3001 - 3500: accelerator tables
3501 - 4000: accelerator table entries
4001 - 6000: dialog controls
6001 - 8000: menu items
8001 - 10000: bitmaps, icons, cursors, ...
10000 - 12000: string table entries
12001 - xxxxx: menubars (Pocket PC)

The IDE will use the next free ID, from any given range, when assigning a new ID (just looking at the resources, not the symbols). If you already have a symbol with this ID - you see the effect you describe. Not really a bug, but maybe somewhat confusing....

Quote from: "alura"

Also found another bug (imho). If you add a new icon, the resource editor modify an existing icon.

I don't understand. Apart from the same problem as above, I can't find anything wrong with icons...

Pelle
/Pelle

Anonymous

  • Guest
Little bug with resource controls id
« Reply #7 on: May 18, 2005, 10:18:02 PM »
Quote from: "Pelle"
Quote from: "alura"

Also found another bug (imho). If you add a new icon, the resource editor modify an existing icon.

I don't understand. Apart from the same problem as above, I can't find anything wrong with icons...
Pelle


Hi Pelle,
I ran into this with both Icons and Cursors... if you use the "Import" function and modify the icon, you end up changing the original, not the imported copy.

I got around it easy enough...  I just copy all the needed cursors and icons to the project directory (using explorer) and import them from there.

alura

  • Guest
Little bug with resource controls id
« Reply #8 on: May 19, 2005, 09:12:17 AM »
Quote from: "Pelle"
Not really a bug, but maybe somewhat confusing....


Oh yes... currently when I fall into this "issue" I manually assign new constant in resource.h but it is tricky.  I like if your resource editor may automatically assign a a free resource skipping the used one, without reporting error. I fell that this will more user friendly.

Quote from: "Pelle"
I don't understand. Apart from the same problem as above, I can't find anything wrong with icons...Pelle


ldblake has reported better a variant of problem. I run on this error when I created a new Icon. After saving the new one, i've found a pre-esistent icon overwrited and the new icon blank. Fortunately I'm used to make backup and nothing was lost (ok, it is just a icon  :mrgreen: ).

Thank's for your prompt replay  :wink:

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Little bug with resource controls id
« Reply #9 on: May 19, 2005, 06:45:30 PM »
Quote from: "alura"
Oh yes... currently when I fall into this "issue" I manually assign new constant in resource.h but it is tricky.  I like if your resource editor may automatically assign a a free resource skipping the used one, without reporting error. I fell that this will more user friendly.

I will look at it - changing this might introduce other problems, so I'm not so sure about this.

Quote from: "alura"

I run on this error when I created a new Icon. After saving the new one, i've found a pre-esistent icon overwrited and the new icon blank.

OK, I see. Not a bug.

When I save a resource script, I want a reference to an external icon/cursor/whatever file - not the script filled with a "hex dump" of the file. When I change the file, I want the changes to be reflected in all places where it's used. If I were to forget the original filename, I must create a new file to save the icon/cursor/whatever in. This would mean that my hard drive would be filled with many identical files. Extremely useless...

Pelle
/Pelle

Anonymous

  • Guest
Little bug with resource controls id
« Reply #10 on: May 19, 2005, 07:50:14 PM »
Quote from: "Pelle"
Quote from: "alura"

I run on this error when I created a new Icon. After saving the new one, i've found a pre-esistent icon overwrited and the new icon blank.

OK, I see. Not a bug.

When I save a resource script, I want a reference to an external icon/cursor/whatever file - not the script filled with a "hex dump" of the file. When I change the file, I want the changes to be reflected in all places where it's used. If I were to forget the original filename, I must create a new file to save the icon/cursor/whatever in. This would mean that my hard drive would be filled with many identical files. Extremely useless...
Pelle


Could you not copy the original into the project directory and work on the copy, leaving the original intact?

For example... I have a collection of about 15,000 icons and I absolutely do not want it getting edited or modified in any way.  I've had to set it all to read-only to prevent that from happening.  

I see no problem with duplicate files.  I would suggest it's safer to make copies than it is to risk messing up the only good one in existence.   There should be no problem with having 25 copies of the same icon, one in each project... at least that way you don't end up changing the icon for 24 other projects when you decide to modify it for your current task.

alura

  • Guest
Little bug with resource controls id
« Reply #11 on: May 20, 2005, 09:05:03 AM »
Quote from: "Pelle"

I will look at it - changing this might introduce other problems, so I'm not so sure about this.


IMHO will be usefull and simple to implement for you...  :wink:

Quote from: "Pelle"
OK, I see. Not a bug.

When I save a resource script, I want a reference to an external icon/cursor/whatever file - not the script filled with a "hex dump" of the file. When I change the file, I want the changes to be reflected in all places where it's used. If I were to forget the original filename, I must create a new file to save the icon/cursor/whatever in. This would mean that my hard drive would be filled with many identical files. Extremely useless...

Pelle


Maybe adding to the tab the name of the icon file (cursor/whatever) will help to track this.

Very good job, Pelles.  :wink:

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Little bug with resource controls id
« Reply #12 on: May 20, 2005, 07:41:09 PM »
Quote from: "ldblake"
I see no problem with duplicate files.  I would suggest it's safer to make copies than it is to risk messing up the only good one in existence.   There should be no problem with having 25 copies of the same icon, one in each project... at least that way you don't end up changing the icon for 24 other projects when you decide to modify it for your current task.

I disagree with you 100% - as usual.

Pelle
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Little bug with resource controls id
« Reply #13 on: May 20, 2005, 07:45:11 PM »
Quote from: "alura"

IMHO will be usefull and simple to implement for you...  :wink:

It's not the change that bothers me, it's the effects of it. I'm not sure your suggestion is useful all the time, but I have to think about it some more...

Quote from: "alura"

Maybe adding to the tab the name of the icon file (cursor/whatever) will help to track this.

Yes, I have been thinking about this - I will probably do so.

Pelle
/Pelle

Anonymous

  • Guest
Little bug with resource controls id
« Reply #14 on: May 20, 2005, 10:27:34 PM »
Quote from: "Pelle"

I disagree with you 100% - as usual.
Pelle


And why is that?

Really, you didn't have a problem when you adopted about a dozen of my suggestions for your new version... so what changed?