|
Good to hear from you again!! Appreciate the quick response.
Thanks,
ns
|
|
|
|
|
Hi,
the reason is that the WM_GETMINMAXINFO is usually only avaiable for Windows. The Visual C++ help index says that this handler fills an array with information of the window. However, since dialogs are considered as a window this seems to be corrected.
Kindly yours.
Alex
|
|
|
|
|
Hi,
My app minimises to the tray using a kind CP person class. It all works really good but my icon is 256 colors and in the tray it looks like it is 16 colours and does not look very good. Can I show it in 256 colors in the system tray or not?
Thank you.
|
|
|
|
|
Be sure you don't have a 16 color icon as well.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
I definitely have not. I have two 256 color icons. I have just now put a 16 color icon in to see if it will use the 16 color one I made which does not look as bad as the one it displays in the tray. I think that perhaps the tray icons are not even 4 bit (16)color.
I can not find anything in MSDN about this problem.
|
|
|
|
|
To avoid icon distortion, be aware that notification area icons have different levels of support under different versions of Microsoft Windows. Windows 95, Windows 98, and Microsoft Windows NT 4.0 support icons of up to 4 bits per pixel (BPP). Windows Millennium Edition (Windows Me) and Windows 2000 support icons of a color depth up to the current display mode. Windows XP supports icons of up to 32 BPP.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/notifyicondata.asp[^]
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|
|
Thank you.
I have read it and what it says about Windows 2000 is strange because I am running Windows 2000 and I get icon distortion. My icons are definite 256 colors and my display mode is definite 32 bit mode.
I wonder what is happening?
|
|
|
|
|
I have a CEdit control mapped to a large size text field. When the Read Only box was unchecked, all lines were showing up fine when I scrolled up and down the control. But I have to set the box to Read Only. Once Read Only was checked, when I scrolled up and down using the scrollbar, all text in the edit box was over written by other text. I looked into help but unfortunately was not able to find any information on this problem.
Eilzabeth
|
|
|
|
|
Sound like an error in Comctl32.dll. Try to get the latest version from MS. (I don't have a link - it can be done with MS's download utility)
|
|
|
|
|
Hi,
the same phenomenon occurs from time to time in Word. Don't know what causes this problem. Are you using the TRANSPARENT property anywhere in your code???
Regards.
Alex
|
|
|
|
|
Yes, I have to use TRANSPARENT property to set static labels background while setting background color to the form.
Eilzabeth
|
|
|
|
|
The only download I saw was for Window95, too old. Can you send me the link?
Eilzabeth
|
|
|
|
|
Use the download utility - the one with the the little hard drives on it.
J.
----------------------------
I got this "baby on board" sign - Now people will stop intentionally ramming our car.
|
|
|
|
|
Can not find it. A url would be greatly appreciated.
Eilzabeth
|
|
|
|
|
I don't have a URL - Even if I had a URL, MS shuffles thing around so much, by the time I gave it to you it would be out of date.
J.
----------------------------
|
|
|
|
|
Hi,
you told me that you are using the TRANSPARENT mode for displaying your data. The TRANSPARENT mode usually hides a given rectangle around a text in a window. This rectangle would usually require a certain space to be displayed - visible or not - on the screen. So if you don't leave enough space for your characters - that is the height of a character in a certain font and the space for the rectangle - you may overlap the rectangle of one line with another. Note: the rectangle i am speaking of is an abstract rectangle which cannot be physically displayed.
You can calculate the necessary number of space for a specific character by using the following code:
TEXTMETRIC tm;<br />
int cxChar, cyChar;
cxChar = tm.tmAveCharWidth
cyChar = tm.tmHeight + tm.tmExtarnalLeading
The TEXTMETRIC structure encapsualtes almost all avaiable information of chars. What your code suffers is a lack of external leading that is the space around a character that is needed to display is. For more information on this structure I refer you to the MFC documentation or
Charles Petzold's Programming Windows 5th edition.
This may look a bit comlicated but in the end its somewhat straightforward
Hope it works
Regards.
Alex
|
|
|
|
|
Just for fun - week of the programmer!
http://www.hot.ee/workingweek/
|
|
|
|
|
Hi,
is this your personal working schedule????
Your work must be really hard regarding your weekend plans
Kindly yours
Alex
|
|
|
|
|
Hello.
Part of the interface that I'm developing requires that there be some sort of interactive periodic table of the elements. I'm not completely sure how I should go about doing this and I was wondering if anyone here had any good ideas for me, or knew where I could find some info on it. I need it to look like the traditional periodic table, but the user is able to click on any number of the elements, and the element number for the ones they select will end up in a list. The only thing I could think of doing was creating one button for each of the elements (which is a lot of buttons!!) and each time a button is clicked, the element number is either added or removed from the list. Anyone have any better ideas they'd like to share with me?
Thanks a lot.
|
|
|
|
|
You could make it so that by dbl-clicking anywhere within that element's cell causes the element to be added to the list. If part of your element class contains info about it's screen coordinates and you create a BOOL ClickInBounds(POINT) member, then you could handle the WM_LBUTTONDBLCLICK by calling each elements ClickInBounds() with the double-click coordinates and it return TRUE if the dbl click was within it's cell.
|
|
|
|
|
Would I end up having to make a table to put all the elements in (I'm not sure how to do this using VC++ 6), or by "element's cell" do you mean just a bunch of static text boxes? (I've noticed that through the class wizard static text boxes only have the option of being single-clicked, which is fine)
I haven't been using VC++ for too long, so I'm still learning all this stuff.
|
|
|
|
|
You should create a PeriodicTable class first and one of its data members would be an array of Element objects. I would attack it by creating an Element class and making sure it had a data member for its row and column in the periodic table.
You would also need a data member for what type of element it was so you could use that type to determine the background color for that element and the font colors.
To draw each cell, you could take the width in pixels of the current window and divide 18 (number of columns). That would act as the height and width of each element's cell. Call this variable
cellwidth.
To determine where to draw each cell, you could take its column, multiply by cellwidth and that number would be the left extent of it's rectangle. Multiplying its row by cellwidth would give you the top boundry of its rectangle. The right and bottom of the rectangle could be determined by adding cellwidth to the left and top values. This will enable you to handle the window resize message and adjust the values in the PeriodicTable class so that your entire table will automatically resize when the window resizes.
Most of that functionality should be stuck in the PeriodicTable class's DrawTable method.
Draw table would call each Element in the arrays DrawElement method.
You do not need to use controls in the resource editor to do any of this. Just use GDI calls to draw the rectangles in the Element::DrawElement() method.
|
|
|
|
|
Arranging such a huge lot of buttons in your dialog seems clumsy to me (plus you'll get close to some limit in the number of controls a resource template can hold --something like 256, if I remember well.)
Maybe you can try laying out your periodic table using some grid control, like for instance Chris Maunder's astonishing MFC Grid control 2.24[^]. The idea is to define one grid control only and fill its cells in OnInitDialog , possibly with information from a config file for maximum fexibility. Some of the cells would be, so to say, void (those outside the table shape) and the others will hold the elements and additional labels (like the group, period, lanthanoids, etc.)
The cells have an overridable OnClick method that you can then use to trigger the appropriate action when the user clicks on an element.
Hope this helps, good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
seems like a fun project . My initial reaction to this was to use something like a grid control . I have had the experience of doing a lot of weird things with grid controls. My experience with Datadynamics #grid control has been good as they have a wide variety of props and methods ! Chris Maunder has a free ctrl . you can have a list corresponding to a cell and set the properties (name , atomic no , atomic weight , blank if some reserved range or pop ups for the lanthanide and actinide series ) . also tool tips that display the same . plus u could add different shading colors to metals , metaloids non metals and inert elements !
|
|
|
|
|
Make a blank template bmp of the elements table.
Fill each box with a unique color and save it.
Create an array of elements and their unique color.
Then make a real bitmap of the elements table using your template and save it.
Show the real bitmap on the window and capture each mouse click's location (point). Take the coordinates of the click on the real bitmap and get the unique color at that location on the saved template bitmap.
Find the color in your elements array and that's the element you clicked on.
"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
|
|
|
|