Jump to content

Background Image for treeview


Markus
 Share

Recommended Posts

Hi,

is it possible to set a background image for a treeview, or make the treeview transparent somehow to display a pic control behind it?

Greets

Markus

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

Hi,

is it possible to set a background image for a treeview, or make the treeview transparent somehow to display a pic control behind it?

Greets

Markus

If the window is layered and you set the background colour of the treeview to some special colour which you define as transparent then you are part of the way there.

If you create a popup window with the image on it all you need to do is to ensure that the main window always has the popup window behind it.

You could register WM_WINDOWPOSCHANGING and use SetWindowPos to set the appropriate Z order and position for the popup window.

Another, but slow, way would be to create a gui with the image where the treeview will be. Create a child window over the image which has the treeview and is the same size as the treeview, using $WS_CHILD only for the window style so there is no border or caption. Set the background colour of the treeview to some special colour and create a mask for the child window based on the area where there is the special colour. When the tree view needs to be redrawn the mask has to be recreated and AutoIt might be too slow for this approach, but it means there is no problem maintaining relative window positions and Z orders.

Otherwise it is complicated if http://www.codeguru.com/cpp/controls/treeview/misc-advanced/article.php/c679 is anything to go by.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If the window is layered and you set the background colour of the treeview to some special colour which you define as transparent then you are part of the way there.

If you create a popup window with the image on it all you need to do is to ensure that the main window always has the popup window behind it.

You could register WM_WINDOWPOSCHANGING and use SetWindowPos to set the appropriate Z order and position for the popup window.

Another, but slow, way would be to create a gui with the image where the treeview will be. Create a child window over the image which has the treeview and is the same size as the treeview, using $WS_CHILD only for the window style so there is no border or caption. Set the background colour of the treeview to some special colour and create a mask for the child window based on the area where there is the special colour. When the tree view needs to be redrawn the mask has to be recreated and AutoIt might be too slow for this approach, but it means there is no problem maintaining relative window positions and Z orders.

Otherwise it is complicated if http://www.codeguru.com/cpp/controls/treeview/misc-advanced/article.php/c679 is anything to go by.

Doesn't work well, as mouseclicks don't reach the treeview sometimes.

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...