Reordering Treenodes in C#.NET - ttreenodes

I have a Visual Studio 2005 C#.NET GUI application. I want to provide the flexibility to reorder the treenodes in the treeview just by dragging and dropping them wherever desired. Is that possible by using any property of the treeview class? Or do I have to do it the hard way by writing events for mouseup and then sensing the dragging of the node etc etc. Any help would be apreciated.
Thanks, Viren

There's better events than mouseup that make this kind of thing easy. This KB article should give you some idea. Read the documentation for the TreeView events that begin with drag for more info.

Related

how to create a Window WIN32?

I just wondering how Windows create this window?
I mean what styles applied to that window, I just want these styles on my project.
As info I use MS Visual C++ 2008.
Thanks
There's no easy way! There's no public API for using "the Windows 8 style", or the style of any other release. You'll just have to replicate it by hand, comparing it pixel-for-pixel against a screenshot. Then update your application with the next release of Windows!
Because they change the metrics of these sorts of dialogs with each release, they can't produce a public library for "system-themed dialogs", because Microsoft would then be unable to change the design for fear of breaking someone's application that maybe uses a bit too much text, for example.

Qt mac switch between panels without changing window

I extensively researched this topic, mainly hindered by that I'm not sure I'm using the right words to describe my issue.
So the point is I'm developing a GUI application in C++ with Qt. The app is being developped on Mac and ftm it's intended only for mac deployment.
I want my app to behave much like System Preferences on Mac, thus accessing different views/panes by clicking buttons on the toolbar.
What I want to avoid is to have one separate window for each pane.
The closest thing I found seems to be QStackedWidget however I'm not sure what's the best way for implementing it.
Should I use it as the main class of my application? Or can I treat it as an object of MainWindow? I'm not a Qt Expert so any further insight or suggestion will be much appreciated. Thanks
QStackedWidget is definitely the way to go. Use it as your main 'container' for your widgets and implement a default main panel widget which contains your entry items, then when you click on one you can push it to be the currently displayed widget in the stack. You could try more complicated solutions to achieve it, but it's significantly easier to do with a QStackedWidget and then focus on how the interaction is handled.

Creating a window that can only be dragged within the parent window

I have a WIN32/C++ app and I want to create child windows in it that cannot be dragged out of the parent window. I want these windows to be owner-drawn, if it matters anyway. Should be simple enough; I'm looking for some basic guidance and tips regarding the subject.
It seems that you want to make an MDI app. This is much easier using a higher level framework such as MFC, WinForms, VCL etc., but can, of course, be done with plain Win32.
The MSDN documentation can be found here: Multiple Document Interface.
What you are looking for is called Multiple Document Interface (MDI).

Right-aligned tab items in Win32 tab control

I am trying to create a tab-control that have the tab-buttons aligned from right-to-left, in Win32/c++. The WS_EX_LAYOUTRTL flag doesn't help me, as it mirrors the drawing completely both for the tab items and the tab page contents. The application itself handles the mirroring automatically (it's a cross platform UI solution), which is also a reason for us not to use WS_EX_LAYOUTRTL flag (we have mirroring implemented in a generic way for all UI frameworks/platforms).
One solution would be to override TCM_GETITEMRECT and TCM_HITTEST in the subclassed TabCtrls window procedure. This enables me to move the buttons allright, but the mouse events still acts on the positions that the control "knows" the buttons really are at (ie. mouseover on the first button invalidates the leftmost button - the coordinates are not mirrored).
So that seems to be a dead end for me.
Another possibility would be to insert padding before the first tab button, to push them all to the right edge. I haven't been able to figure out how to do that, though. Visual Studio sports this little dialog:
How did they put the buttons in front of the first tab page? Knowing this would enable me to solve this problem.
Update, solution:
The solution to my problem is to use the built-in RTL support. For this to work, the tab control must have both the WS_EX_LAYOUTRTL and WS_EX_NOINHERITLAYOUT flags. That will preserve the function of all existing drawing code while only the TabCtrl buttons are mirrored. I didn't realize that the ES_EX_NOINHERITLAYOUT flag goes on the parent (the TabCtrl), which is why I was looking for the workaround originally described.
For reference, I am still curious to have an answer to the original question, though.
If you take a look with a spy application you will see that it is not actually a normal windows tab-control but custom thing and the drawing is done by the parent window AFAIK:
Both Visual Studio and Office use a lot of custom controls, some of the features make their way into the common controls after a few years, some features stay private...

Custom system tray icon "balloon tooltips" for Qt?

I know that in the .NET framework there are a handful of alternative third-party controls for normal system tray icon "balloon tips", that allow you to change the colors and add some styling to the balloon.
I was wondering if there is something similar for Qt, which allows for better customization of the look, style, and feel of the balloon tooltips from a system tray icon.
You should have a quick glance at the "Qt Style Sheets" examples in QtAssistant. It provides strong and many ways to alter widgets looks and feel... Maybe you'll find something interesting there !
Otherwise, you could have a look at QSystemTrayIcon & QBalloonTip. Maybe by reimplementing those classes...
Hope this help a bit !