Windows Visual Themes: Gallery of Parts and States? - windows

Microsoft Windows lets programmers draw GUI elements using the look and feel of the current theme using functions like DrawThemeBackground and DrawThemeText. The elements are specified by Class, Part, and State, as described at the Parts and States page at MSDN.
Unfortunately, the page is not very informative (at all!). So the question is: is there somewhere a reference of all these parts and states, preferably with images of the elements (in the default Windows Vista/7 theme)?

I have created a small Windows application, programmed with the table at Parts and States. This application lets the programmer browse and explore all parts and states, using the current OS theme.
(High-Res)
It can be downloaded at
https://privat.rejbrand.se/UxExplore.exe
The (Delphi, Win32 API) source, which is too long to be posted here (due to hundreds of constants) is found at
https://privat.rejbrand.se/UxExplore.zip
https://privat.rejbrand.se/UxExploreMain.html
https://privat.rejbrand.se/UxExploreConsts.html

You're looking for this.

Mike Lische, who wrote the first Theme support for Delphi (which was later absorbed by Borland) has a very good Theme Explorer demo application:
It's not been updated to support new Windows 7 common controls, but its parts/states explorer is very pretty.
And if i may say, Andreas, a design you might want to copy for yours :)

Much more comprehensive theme explorer: mCtrl Theme Explorer

Related

Can you change the theme of an existing powerpoint with Python-pptx?

I was wondering if there was any way I could change the theme of an existing PowerPoint using Python-pptx.
I realise that the easiest way of inserting a specific theme of a powerpoint, you just open a "template powerpoint" with the theme in it. However, I want to automize converting themes of existing PowerPoints, I'm not creating new PowerPoints from scratch.
You might say: just copy and paste slides into the PowerPoint with a specific theme. However, copy and pasting slides is extremely error-prone as well, seeing they work with slide indices which seem quite tricky. And I'm not even sure whether the pasted slides automatically assume the theme of the new document.
Therefore I was wondering if anyone knew of some kind of theme object I could call and change using Python-pptx?
Thanks in advance
The short answer is no. Implementing that would be a fairly big deal and there are no current plans to add it.
If you wanted to do that to several decks, you might explore using Visual Basic for Applications to do it in a Microsoft Windows environment. You might also explore using the win32com interface to control the PowerPoint application from Python, I think that also requires a Windows environment.

How to approach implementing a layout editor using Cocoa

I want to build an OS X application, in which one of the requirements is for the user to be able to generate PDF output according to a layout that they, the user, will create. Typical items on the page would be things like a corporate logo (a JPEG or PNG), an address (a block of text) and a narrative (another block of text).
I'd like the user to be able to move and resize the items using the mouse to drag handles around on-screen.
Is there an Interface Builder object that will let me do that, or some third-party library that exists for this purpose?
Try GCDrawKit if you're looking for a drop-in solution. It's still in beta (and has been for ages) but you might find it useful.
You seem to be looking for an all-encompassing, self-contained "Pages" control or some sort of reporting suite. That's asking a bit much.
There is nothing in the Cocoa frameworks that gives you this. Unfortunately, there's no Cocoa equivalent of Crystal Reports either. You'll have to roll your own.
I suggest using standard CSS / HTML templates with WebKit. The only drawback is WebKit doesn't yet support CSS pagination, so there's no concept of "8.5"x11" page 1...15" but it's the closest you'll come without writing your own Pages application (NOT an easy project by any stretch of the imagination).

Is there a catalog of all UI widgets and their names, platforms and languages?

I was looking at the Firefox Add-ons Manager UI (pictured below) and really liked the expandable list used to show settings or properties for each add-on.
Firefox Add-ons Manager http://uploads.tech-buzz.net/Firefox3Beta3ComingonMonday_859/get_addons.png
I liked it enough to want to include something similar in one of my applications. The problem is, I don't know, exactly what the control is called (it doesn't seem to be "expandable list"), nor do I know if there is an implementation available for use in my own application (so I wouldn't have to reinvent the wheel.)
This isn't the first time that I've seen some cool piece of UI and wanted to incorporate it into something I'm working on, but have had no idea if I would have to design it from scratch. So I generally end up reworking my UI to use standard UI widgets to save time.
This got me thinking, is there some place that has a catalog of a bunch of UI widgets with names and what platforms/languages they are implemented for/in?
UPDATE
Turns out this control is called a Rich List Box, and it seems to only be implemented in XUL.
To answer your question, no, there isn't a universal catalog anywhere, though MSDN is as good a place as any to find definitions of most common UI elements.
The specific widget you ask about is generally called an accordian (wikipedia)

Which VB6 controls are supported by Microsoft?

I'm looking for a replacement for the Sheridan 3D Panel (ssPanel) and I'm trying to figure out which of the Controls in the Projects>Components I can add to my project which will be supported by Microsoft. (I.e., I don't want to add a control that MS doesn't officially "support", like the MS Forms 2.0 Object Library).
Update
Microsoft does still support VB6 (or at least the files that it uses)
There is no list of supported controls: you have to look at the list of supported OCX files in the Microsoft Support Statement for VB6. You need to figure out which controls are in those OCXs. You could start a new VB6 project, tick the OCXs in Project-Components, and see which controls become available in the toolbar.
Confession I have made this answer Community Wiki, because this information was originally in a comment to another answer, but that answer is now deleted. Feel slightly guilty as I downvoted the answer (it said VB6 is unsupported which is misleading).
What part of the SSPanel behaviour do you need?
If it's the custom appearances (raised 3D edge etc.) it's not too hard to write a user control based on the intrinsic VB6 Label and Line controls. Have a look at the edge of the SSPanel in the magnified screenshot below. It's just a one pixel border. The colours are system colours: left and top are "button highlight" &H80000014& and the right and bottom are "button shadow" &H80000010&. Put four line controls in a user control and write code in the resize event to move them to the edge of the control.
alt text http://img194.imageshack.us/img194/5376/sspanelzoomin.png
If you need a label that can act as a container, you could make your user control capable of being a container (set ControlContainer True).
Vertically centred text. Offhand I don't know a good way to do that. Google is suggesting creating a user control with a PictureBox and using the TextHeight method.
EDIT There's another approach, which I'm using in some of my projects. Just continue to use the SSPanel despite it's being unsupported and with awareness of its various problems. It does seem to work fine on Vista and XP - haven't tested yet on Windows 7.
Just as a side note to expand on MarkJ's thought (I realize this question is a little old, but I recently had to deal with porting some old VB apps): There are some cases where SSPanel is used as a container with background colors, and without text. Although it may seem like stating the obvious, the Forms.Panel does work fairly well class to avoid the "Sheridan 3D Controls" dependency and make distribution easier in these simple cases.
The VB.net converter tool may generate something like:
Public WithEvents ssPanel As AxThreed.AxSSPanel
Me.ssPanel = New AxThreed.AxSSPanel
ssPanel.OcxState = CType(resources.GetObject("ssPanel.OcxState"),
System.Windows.Forms.AxHost.State)
CType(Me.ssPanel, System.ComponentModel.ISupportInitialize).EndInit()
Which is easily changed to:
Friend WithEvents ssPanel As System.Windows.Forms.Panel
me.ssPanel = New System.Windows.Forms.Panel
' No longer necessary:
' ssPanel.OcxState
' CType(Me.ssPanel, System.ComponentModel.ISupportInitialize).EndInit()
A comment from MarkJ made me re-read the Q, and from "replacement" I now understand this is likely a re-code/new version project, not a start from scratch... the original answer below is not accouting for that.
Meanwhile, MS says it's suportting a core runtime file of a language that has no roadmap or committed resources (?), so bottom-line of my answer still stands: vb6 stopped, new projects can go Python, vb.app, java, c++, C#, whatever.
Original:
None. VB6.0 reached its End-Of-Life. Go Python! or Java, or C#... never vb .net, because it's tons harder/dense than Java, not VB6.0 syntax in the slightest, and the learning curve is just a notch under C#.
P.S. It's so interesting to have negative votes because I trashed vb .net when compared to java or c#.
I wonder what these guys would think of me, being a former vb6 programmer, and not moving to any of the .net flavors.

Using pictures as buttons?

I talked to a friend of mine and he told me that it's possible to create an image in an image editor (gimp/photoshop) and then use it as a button . He said that's the way applications that have great GUIs do it.
He also said that there is a file describing which parts of the image make up the button.
Is this possible , or is he "crazy"? :)
This needs to be clarified with a language of choice, etc. In general, most languages (WinForms, Java AWT/SWT, etc) have an image or background image property that allows you to use images for buttons. There are even skinning frameworks that will let you use images for all controls in an easy-to-define manner.
If you are talking about HTML, there is a button input type that can allow an image to be used as a button for a form.
#Vhaerun
CodeProject is a good place to find lots of skinning libraries. I used this one a long time ago. Winamp is a great example of a skinned application, where users can actually create their own templates to completely change the look of the application without changing code whatsoever. Actually, most media players have some sort of skinning available.
You can do anything, especially since you have no constraints re language, environment, etc.
No he is not crazy, you can use images on almost all GUI tools instead of buttons, they are generally an image on the button, or in some cases you can put the image on the screen and have an onclick event assigned to it.
You haven't been very specific with your question so nobody is able to give you a definitive answer, but here's an attempt to do so without demeaning you:
It's quite common for graphics designers (using tools like photoshop, gimp, etc.) to participate alongside developers for both desktop and web based applications. Web based applications can easily capture information about when an image is clicked and frequently people will either design the button with the text in the image file itself, or use background pictures/borders with plain text on top. There is not standard, per se, on how this is accomplished on the web, but plenty of sites serve as an example (try using Firebug with FireFox to inspect other sites and see how they do things).
If the circumstance at hand is desktop oriented then the answer becomes much more complicated. Skinning is accomplished in many way and, depending on platforms and libraries being used, implementation specifics vary greatly. In it's most simple terms, most GUI frameworks (like GTK, QT, Windows Forms, Windows Presentation Foundation) include a basic picture control, and this control can usually process a "Click" event, which would allow it to function as a button, but if you want different states (pressed, disabled, etc.) you will have to invest more effort in such a thing; you also won't find this method suitable for replacing the rendering of all buttons in an application, but rather something you would do manually for each one, or write your own custom button control that uses your assets specifically.
In terms of a file describing different images that combine as described in the file to override the rendering of the button this would lead me to believe you are either working with an already existent application that is skinable (like Firefox or Winamp) or that he is speaking of some specific UI toolkit. I'm not aware of this functionality being generally available in most of the common system-level UI toolkits.
In the future you may wish to be more specific with your questions.
In HTML, you could do:
<input type="button" src="/path/to/image.png" />
Alternately, assigning an onclick event to an image causes that image to work similarly to a button:
<img src="/path/to/image.png" onclick="function(){doSomething();}" />
If you're talking HTML you can use <input type="image" src="myfile.png" />
Specifications here
Imagemaps I guess.
No seperate file describes the map, it is all part of the html document.
http://www.w3schools.com/TAGS/tag_map.asp

Resources