The menus to select a tab

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Locked
poy
Posts: 83
Joined: 2006-04-03 15:55

The menus to select a tab

Post by poy » 2006-06-01 08:53

hi

in the "Window" menu, there are menus that are added / removed when you open / close a tab. it seems to be an automatic feature of an MDI app, because i've not found anything related to it in WinUtil, where the menus are created.

so, i was wondering... where do they come from ? how are they created / removed ?

thanks :)

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2006-06-01 17:42

They're handled automatically. Use a language file that translates "Window" to something else. When you do that, the MDI child windows will no longer be added and removed from the menu. Thus the behavior of the "Window" menu is dependent upon its name and is handled at a much lower level than in DC++'s code - you'll have to look in WTL itself.

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-06-01 18:32

thanks a lot "GMT" (ok easy joke...) :D

i searched a bit through WTL and found a nice match for "&Window", it's in atlframe.h and it begins with :

Code: Select all

#ifndef _WTL_MDIWINDOWMENU_TEXT
#define _WTL_MDIWINDOWMENU_TEXT	_T("&Window")
#endif
exactly what needed :)

so i believe that to translate correctly DC++ it would also be needed to set this _WTL_MDIWINDOWMENU_TEXT to the language's corresponding MENU_WINDOW (275'th line of StringDefs.h). but i don't really get how this could be done though, since _WTL_MDIWINDOWMENU_TEXT is set on the compile time :?

whatever, thanks 8)

EDIT : maybe adding this :

Code: Select all

#define _WTL_MDIWINDOWMENU_TEXT CTSTRING(MENU_WINDOW)
to the beginning of stdafx.h would solve this problem :wink:

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2006-06-02 17:22

Yes, that is a problem. I'm not sure what the solution is. If you're interested in keeping it on the radar, you could enter it as a bug in Bugzilla... :)

poy
Posts: 83
Joined: 2006-04-03 15:55

Post by poy » 2006-06-03 13:32

sorry i'm not going through the registration and stuff and stuff... (you may have noticed i use a proxy, btw). several reasons in it...

but really i think that only adding :

Code: Select all

#define _WTL_MDIWINDOWMENU_TEXT CTSTRING(MENU_WINDOW)
to stdafx.h right before the #include of atlframe.h solves the problem (haven't tested though).

Locked