Window vs Offscreen window - user-interface

In the 3xx versions of GLADE Interface Designer there is a toplevel widget called "Offscreen window", which icon has the looking of that:
How it differs from the common window toplevel widget and what is it used for?

It's used for containing widgets that should not be on screen, yet should be drawn / rendered. According to the documentation the only supported use is screenshots:
GtkOffscreenWindow is strictly intended to be used for obtaining snapshots of widgets that are not part of a normal widget hierarchy.
However, it also sometimes comes in handy for unit tests.

Related

What is this gtk widget called

image
I'm talking about the circled part and to give further context you can drag it then it becomes a standalone window looking thing.
They're the tabs of a GtkNotebook.
For future reference, if you want a visual overview of the widgets in GTK: the documentation provides a widget gallery

Why aren't my MDI child forms showing a shadow?

In my application when I make a form as a child form of my main MDI parent form, the child form stops showing Windows 7 default shadow effect behind forms. How do I get child forms shadow to show?
Form obj = Application.OpenForms["My_form"];
if (obj != null)
{
obj.Focus();
}
else
{
My_form c = new My_form();
c.MdiParent = this;
c.Show();
}
This is normal, entirely by design. MDI child windows are not top-level windows, but rather a special type of child window that is designed to be hosted in an MDI parent window.
The Desktop Window Manager (DWM), which is what is responsible for the Aero effects in Windows Vista and 7, only adds drop shadows and glass transparency to top-level windows. Your MDI child windows don't qualify for this treatment. In fact, the shadow isn't the only thing they're missing--they look like they're drawn using the Aero Basic theme, which is pretty visually jarring on a machine that is using the Aero theme for everything else.
Unfortunately, there's no fix for this other than to switch away from MDI altogether. The multiple document interface has been pretty much deprecated nowadays anyway. Such interfaces provided more difficult for people to use than was originally expected, and they've fallen into almost complete disuse, particularly by Microsoft's own software. You'll notice that rather than using MDI, Microsoft Office uses multiple top-level windows. You should probably consider doing the same thing with your own software.
Another popular alternative to MDI is a tabbed interface, commonly used by web browsers. Here, you have a single, top-level window and all of the child windows appear as "tabs" at the top of this main window. The user can switch among child windows much more easily and intuitively as tabs rather than as independent MDI children.
I got the answer finally , if i make a form as child form like
c.MdiParent =this;
It makes the appearance of the form as flat , If you like to show the form as default windows like forms
dont make the form's mdi parent !

How does a Windows non-native user interface work?

Through experience I have found that the native windows forms/components don’t like to be changed. I know using Delphi or Visual Studio you are given native windows components to populate a form or window with and then you attach code on events that these components may do (onClick for example).
However, how do all of these programs like Word or google’s Chrome browser alter the standard windows’ window? I thought it was somehow protected?
Chrome seems to have tabs actually on the window’s frame?
I know you can also get toolkits like Swing and QT that have their own controls/components to populate a form. How do these work? (How does the operating system/computer know what a non-native button should act like? For example; Chrome's back and forward buttons, they're not native components?).
I can understand how OpenGL/DirectX window would work because you’re telling the computer exactly what to draw with polygons/quads.
I hope this question is clear!
Windows does not protect GUI elements. Windows and controls can be subclassed to handle various drawing operations in a custom way. For example, windows may override and reimplement the handling of the WM_NCPAINT message to draw a custom titlebar and frame:
http://msdn.microsoft.com/en-us/library/dd145212(VS.85).aspx
Some Windows controls have an "owner-draw" mode. If you use this, you get to draw the control (or at least vital parts of the control), while Windows takes care of responding to user input in the standard way.
Swing ant QT draw their own widgets at a low level using basic primitives, but they also have theme engines which can mimic the native controls.
Qt moved to native controls a while back. As for how swing does it, it gets a basic window from the OS. Then much like Opengl\Directx it does all of the drawing with in that window. As for where to position things that is what the layout managers do. Each manager has a layout style horizontal, vertical, grid, components it has to draw and a section of window it is expected to fill. From there it does some pretty easy math to allocate its space to its controls.
There's no magic: non native controls are simply drawn on a blank window. Or, instead of being drawn they may be represented as one of several bitmaps based on state (ie: a button may be represented as a .png for the normal state, another .png for the pressed state, etc)

COMCTL Common Controls Progressbar displays ugly blue bars

I have a VB6 program which uses comctrl32.ocx to display a progress bar. I've also had programs using mscomctl.ocx. However, it is displaying it using the ugly, old-style blue boxes progress bar instead of using the new-style progressbar (which presumably varies depending on the OS). Other programs which reference that same ocx file display the new-style progressbar (unless I run them VB6, in which case they still use the ugly one). All of the properties of the control are the same. Any suggestions on what I'm doing wrong?
Most likely, your application doesn't have a manifest and therefore uses the old pre-Windows XP style common controls. vbAccelerator has a great article on how to add one

Rewrite standard controls like edit, combo, etc?

I have a custom control: it's managed code, which subclasses System.Windows.Forms.Control.
I want to add things like edit boxes, selection lists, combo boxes, radio buttons and so on to places on this control. An easy way to do this is to simply add instances of these classes to the Controls collection, so that they become child controls.
Adding them as child controls might create some subtle problems, for example:
IE 6 select controls(Combo Box) over menu
I have scrollbars on my control which appear to scroll the contents of the control (the contents are bigger than the control itself); when a child control is near the edge of the screen then I'd like to half-display (i.e. clip) that child (i.e. to have half of it located off the edge of the physical screen), but a true child control cannot be located outside the border of its parent.
Are there other potential problems?
When I use IE7 to display http://www.tizag.com/htmlT/htmlselect.php (for example), which contains combo boxes etc., and when I then use Spy++ to spy on IE7 when I'm doing that, I see only a single Window/control instance with no children (whose class name is "Internet Explorer_Server").
I'm guessing this means that in IE7, the functionality to render a combo box is built in to the IE7 control itself, and that IE7 does not use standard controls as child controls.
Questions:
Is it better to reuse standard controls as children of a custom control, or, to reimplement the functionality of standard controls within a custom control itself?
Do you have any caveats (warnings) to share, related to either scenario?
If I wanted to reimplement the functionality of standard controls within a custom control, do you know of any existing code (which implements this functionality) that I could re-use?
If such code already exists, I don't know how to search for it (my searches find, for example, owner-draw combo boxes, and extensions to standard combo boxes): perhaps few people reimplement the standard controls from scratch?
Edit
I found a semi-related question: How to render a control to look like ComboBox with Visual Styles enabled?
Yes, Internet Explorer draws the controls using the Windows theming APIs. You can do this too using the types defined in the System.Windows.Forms.VisualStyles namespace.
The IE team did this to avoid performance problems of having so many controls, each receiving window messages, on screen at once. For example, looking at this StackOverflow.com page, I see 30-40 link label controls, 10 buttons or so, 20+ labels, etc.
It should be noted the Zune software, which is .NET managed code, also uses custom controls; if you try to use Spy++ on any of the controls, you'll see they aren't real Win32 controls. You may use Reflector on the Zune software to see exactly what they're doing. If I recall right, they're using a custom managed UI framework that's included in the Zune software.
As far as rewriting these controls from scratch, I think there's a ton of work to be done. It sounds easier than it really would be.

Resources