Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Karl Wochele Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Icon draw question Date: Tue, 22 Sep 2015 13:15:48 +0200 Lines: 107 Message-ID: References: <6fb6b4eb-0d75-489d-8015-cad5be58accd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net yB95yQpyeAAN+b2QjJ4qPwHNOMSE2tPxZ3T+nh+TbpaF8Ne01n Cancel-Lock: sha1:e44ZRo0jpFYvj75XM4HopSiZHDI= User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <6fb6b4eb-0d75-489d-8015-cad5be58accd@googlegroups.com> Xref: csiph.com comp.lang.clipper.visual-objects:8423 Hi Fabio, you might try to use the background of your shellwindow as the background of your fixedicon, e. g. class MyFixedIcon inherit FixedIcon METHOD Expose(oEvent) CLASS MyFixedIcon SELF:Background := Brush{} SUPER:Expose(oEvent) RETURN SELF HTH Karl Am 19.09.2015 um 22:57 schrieb Fabio Romling Rotheia: > Hey Franz and Karl, > > You guys are Genius! > It Works!! > > Another question: The icon is not transparent, like when i draw with DrayIconEx. Is there a way to make it transparent? > > Thanks a lot! > Fábio. > > Em sábado, 19 de setembro de 2015 13:26:08 UTC-3, Karl-Heinz escreveu: >> Hi Fabio, >> >>>> Since i'm using DrawIconEx() to draw the icons on the >>>> shellwindow and they are not controls, how can i hide and show them? >> >> >> try a FixedIcon Control: >> >> >> 1. Create the control dynamically in your ShellWindow show() - after >> super:show() >> >> e.g. >> >> _oFixedIcon := FixedIcon { SELF:handle( 4 ) , 4711 , Point { 20 ,20 }} >> _oFixedIcon:Size := Dimension { 16 , 16 } >> >> _oFixedIcon:SetIcon ( _oRedIcon ) // initial icon >> _oFixedIcon:Show() >> >> >> 2. _oFixedIcon, _oRedIcon and _oGreenIcon are protect vars of your shell >> window. >> >> protect _oFixedIcon as FixedIcon >> protect _oRedIcon as Icon >> protect _oGreenIcon as Icon >> >> >> 3. create the required icons inside the Shellwindow Init() >> >> e.g. >> >> _oRedIcon := Icon {ResourceID{"icoLEDRed",_GetInst()}, LR_DEFAULTCOLOR , >> 16,16 } >> _oGreenIcon := Icon {ResourceID{"icoLEDGreen",_GetInst()}, >> LR_DEFAULTCOLOR , 16,16 } >> >> >> >> 4. Inside the MdiClientProc you have always access to the shellwindow object >> >> e.g. >> >> case uMsg == WM_MOUSEMOVE >> >> oShellWin := GetObjectByHandle ( GetParent ( hWnd ) ) >> >> Forward the required messages either to your shellwindow or switch the >> icons within the MdiClientProc. >> >> e.g. >> >> if ismethod ( oShellWin , #SwitchIcon ) >> send ( oShellWin , #SwitchIcon , #Green ) // or #RED >> endif >> >> >> method SwitchIcon ( symIcon ) class YourShellWindow >> >> do case >> case symIcon == #Green >> >> _oFixedIcon:SetIcon ( _oGreenIcon ) >> >> case symIcon == #Red >> >> _oFixedIcon:SetIcon ( _oRedIcon ) >> >> endcase >> >> >> In Germany we would say: "i hope you can follow me" ;-) >> >> regards >> Karl-Heinz >