Delphi TListBox contents overflow when selecting (Win7, 32bit, themed) - delphi

I've a TListBox on a Windows form with 966 elements in it. When I click a button on my form, a subset of these strings are selected (roughly 200 of them).
If I now unfocus my application by clicking somewhere on the task bar, the entries from my TListBox bleed upward, so as they are visible above the boundaries of the TListBox. They are thankfully bleeding out behind the TGroupBox component which is directly above them - however this still looks extrememly unpolished.
I'm able to reproduce this only on one Win 7 x64 machine using the Aero theme (I've another Win 7 x64 laptop which doesn't exhibit the same problem with the same theme setting).
I've tried issuing a PostMessage( Self.Handle, WM_PAINT, 0, 0) directly after changing the select status, preceded by a ListBox.Refresh. This doesn't help.
Any help would be much appreciated. Please advise if you need more details.
Cheers, Duncan

Are you using the XPManifest unit, or have you enabled themes for your app? If so, try not using it to see what happens. It can be very bad if you dont have a good video card.
My 2 cents? Avoid using themes at all. It simple does not work very well.

Related

Delphi D2010 Component Palette icons all wrong

I have just built a new system. (Win 8.1, 64 bit, D2010). Install went fine... adding some various VCLs. For some reason, in the Delphi Component Palette, all component glyphs PAST the 'Gestures' palette are all defaulting to the 'generic' icon. The first 13 tabsheets use proper icons. The remaining 30 or so tabsheets use the generic 'Blue box, red triangle, gold circle' image.
Delphi compiles my apps fine. For some reason the GLYPHs are just messed up. I have exited Delphi, restarted, even rebooted the machine. It was initially working fine, but then it messed up. So what did I do? I installed a few components, which I have installed before... I added some help files to the Windows help system for one of the components. I added some directories to the Delphi Path, and added a new BPL file for some of the components, and I went into the Tool/Options/Component Tool Bar and moved one component from a page by itself to another page. This left an empty page/tabsheet, so I deleted it. Thinking this might be the problem, I went back in and clicked on 'Reset to Default'. It did reset the one component back to a page by itself. Restarted Delphi... same issue.
UPDATED INFO***: Some Embarcadero supplied pages show fine, others show 'Unknown/Default' Glyph. For example, the first 13 pages are good, then are 10 or so pages bad, then SAMPLES, INTERNET, and few others are good. Pages that are bad include INDY (the whole set) and IW (the whole set). All my TMS stuff is good (which I installed). Some of the JVCL pages are good, some are bad. Interestingly, one page, Jv Edits, is half bad, then the rest of the page is good.
I don't know why, but when I switched back and forth to different IDE Layouts (Default Layout, Classic Undocked, etc) a few times, the palette glyphs got reloaded, and now everything looks as it should.

How to make my Deskband's (Taskbar Toolbar) Form transparent

I'm working on a Windows Deskband in Delphi XE2 for Windows XP, Vista and 7 (Win32 and Win64)...
I've implemented all the necessary interfaces (ITrayDeskBand, IDeskBandInfo, IDeskBand2, IDeskBand) in my code, and that all works exactly as it should (there are no warnings on Vista/7 complaining about compatibility as others have experienced).
The problem I have is that my Deskband Form appears with a non-transparent band. Also, only certain Controls are displaying (in this case TBitBtn and TImage containing a PNG). I need it to display TEdit and TComboBox objects properly too, but they won't appear at all.
I've tried enabling GlassFrame and SheetOfGlass properties on my Form, but this doesn't help one bit.
Furthermore, the Form itself is exceeding the top boundary of the Taskbar, meaning you cannot (for example) resize the Taskbar if the cursor is in-line with the top of the Taskbar immediately above my Deskband.
I believe there is something Delphi's VCL TForm type is doing behind the scenes which renders the TForm type incompatible as a Deskband container... but this is just a suspicion.
Here's a screenshot illustrating the various problems:
As you can see (above), the Deskband's Form is pale (instead of Transparent), it overlaps the top of the Taskbar (preventing resizing and Autohide triggering when the Taskbar is "hidden")
Any ideas?
UPDATE 1
Okay, I have been playing around and noticed that a totally different behaviour is observed when creating a TToolBar control to be used for the Deskband, rather than a form:
Notice there are three TToolButton controls (with their text virtually invisible due to the Glass theme)? There should also be a TEdit and TComboBox between two separators, but these refuse to display at all.
Also notice the artefacting (the repetition of actual Taskbar Icons)?
I'm not sure if this is a step in the right direction or not, but it might help you (or others) to deduce a solution!
Okay... I've finally figured this out, and it is the most absurd thing I've ever come across.
I'm posting my findings here for the benefit of others (to save you going through the nuisance I've just been through).
To get all of the controls on your Deskband Form to display and function properly, simply set the Visible property of your Form (in the IDE designer) to True.
Ridiculous, I know, but it works and is easily repeatable.

Chevron button in delphi dialog form

I want to draw a Chevron button
in a custom dialog form and I'm wondering if exist a State and Part constant to be used with the DrawThemeBackground function or I must draw this kind of button manually?
The closest I can find for XP is
ThemeServices.DrawElement(Canvas.Handle, GetElementDetails(tebNormalGroupExpandNormal),
Rect(10, 100, 100, 200));
or
EBP_NORMALGROUPEXPAND using DrawThemeBackground directly. However this draws a double arrow (on XP at least)
However later windows versions also have TDLG_EXPANDOBUTTON, which is what you want judging by the image at Where do I find the icons / animations recommended in the Windows 7 UX guide?
Thanks to Andreas (as usual for theme and customer drawing related questions)
See also his utility at Windows Visual Themes: Gallery of Parts and States?
Ideally I would use the second version if available, but fall back to the first on XP.
You can't find it in the list of Parts and States? Then it doesn't exist. http://msdn.microsoft.com/en-us/library/bb773210(v=vs.85).aspx

3 TToolBar's on a TCoolbar band

I have TCoolBar with two bands. On the first band I want to put 3 separate TToolBar's in it. I take TToolBar in TCoolBar and set align to alNone but cannot adjust the size of TCoolBar.
I look at my Delphi 5 and it uses TControlBar that the sites tell me to avoid.
I'm installing Speed buttons on my Toolbar with spaces and separators to get flat button effects.
has any one got a good solution to this problem
Thanks in advance.
I can't replicate your problem. Here's what I did (exactly):
Started Delphi 7, which gave me a new blank VCL forms application
Dropped a TCoolBar on the form, and then dropped three TToolBars on the CoolBar.
Hit Escape to change the designer's focus from the last dropped ToolBar.
Used Shift+DownArrow to increase the height of the CoolBar so that all the ToolBars were visible.
EDIT: After posting this, I also tried setting the TCoolBar.AutoSize property to True instead of manually resizing as the last step above describes. This also worked properly.
I don't know what
I look at my Delphi 5 and it uses TControlBar that the sites tell me to avoid.
means. What "sites", and why "avoid"? If you're telling us that the Delphi 5 IDE uses TControlBar, IIRC D5's IDE worked just fine.
Also, don't use SpeedButtons on a TToolBar. A TToolBar is designed to hold TToolButtons, which you can put on the TToolBar by right-clicking it and choosing either "New Button" or "New Separator" from the context menu.

Where can I find a movable toolbar demo?

At the top of the Delphi IDE is a toolbar with buttons grouped together on little movable trays. I'm trying to implement something like that, but not having much success. I've found TToolbar, but I can't figure out how to set up the movable trays. Does anyone know where I could find a simple demo app that shows how it's done?
I believe the webbrows.dpr located in the cool stuff demo directory (and included in all installs of Delphi since around Delphi 6 or so) contains just the demo you are looking for. This gives you the effect your looking for using only CodeGear supplied components. You add multiple bands and set the fixed size to false for the bands you want to allow to be movable.
You can try the Toolbar2000 Component from Jordan Russell or the TBX package wich is an extension for Toolbar2000 components.
Toolbar2000 is a set of components for CodeGear Delphi and C++Builder designed to mimic the Office 2000 look and behavior. It includes draggable and dockable toolbars and menus.
alt text http://www.indasoftware.com/_files/img/fordev/office2003/small_classic.png
you can see these links.
Office2003 Theme for TBX
Mac OSX Theme for TBX
TBX themes
Bye.
You can put your toolbars in a standard VCL TCoolBar or TControlBar. AFAIR this can get a bit messy sometimes. For an example, have a look at the CoolStuff demo, as skamradt suggested.

Resources