How to draw in a mimized dialog ?

How to draw in a mimized dialog ?

Postby toninhofwi » Tue Nov 28, 2006 9:57 am

Hi friends.

I need know, what I need to draw on the minimized dialog.

For example: when I click to minimize a dialog in my main window app, a little bar (like a tittle title dialog) appear in my app right ? I need a way to draw a red line on it.

Thanks and best regards,

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Postby Marc Boissinot » Tue Nov 28, 2006 9:53 pm

Here's a try for mdi child windows inside a mdi frame.

Code: Select all  Expand view
#include "FiveWin.ch"

#define WM_ERASEBKGND         20
#define WM_ICONERASEBKGND     39
#define WM_MDIACTIVATE       546
#define WM_NCPAINT           133

function Main()

  local oWin, oDlg

  OVERRIDE METHOD NCPaint     IN CLASS TMdiChild WITH MyNCPaint
  OVERRIDE METHOD Paint       IN CLASS TMdiChild WITH MyPaint
  OVERRIDE METHOD MdiActivate IN CLASS TMdiChild WITH MyMdiActivate
  OVERRIDE METHOD HandleEvent IN CLASS TMdiChild WITH MyHandleEvent


  DEFINE WINDOW oWin TITLE "Main Window" MDI

  ACTIVATE WINDOW oWin


function RedLine(oWnd)

  local hPen := CreatePen(PS_SOLID,1,CLR_HRED)
  local hOldPen
  local aRect, nLineDC

  aRect := GetWndRect(oWnd:hWnd)

  nLineDC := GetWindowDC(oWnd:hWnd)
  hOldPen := SelectObject(nLineDC,hPen)
  MoveTo(nLineDC,0,10)
  LineTo(nLineDC,aRect[4]-aRect[2],10)
  SelectObject(nLineDC,hOldpen)
  DeleteObject(hPen)
  ReleaseDC(nLineDC)

  return nil



function MyMdiActivate( lOn, hWndAct, hWndDeAct )

  local self := HB_QSelf()

     if lOn
        if ::oMenu != nil
           ::oWnd:SetMenu( ::oMenu, ::nMenuInfo )
        endif
     else
        if ::oMenu != nil
           ::oWnd:SetMenu( ::oWnd:oMenuStart )
        endif
     endif

     if IsIconic(::hWnd)
       RedLine(Self)
     endif

  return nil

function myNCPaint(nWParam)

  local self := HB_QSelf()

     if IsIconic(::hWnd)
       RedLine(Self,nWParam)
     endif
     return ::TWindow:NCPaint()

function myPaint(nWParam)

  local self := HB_QSelf()

     if IsIconic(::hWnd)
       RedLine(Self,nWParam)
     endif
     return ::TWindow:Paint()

function MyHandleEvent( nMsg, nWParam, nLParam )

   local self := HB_QSelf()
      if nMsg == WM_MDIACTIVATE
         return ::MdiActivate( ::hWnd == nLParam, nLParam, nWParam )
      elseif nMsg == WM_NCPAINT
        return ::NCPaint()
      endif

return ::TWindow():HandleEvent( nMsg, nWParam, nLParam )

Marc Boissinot
 
Posts: 6
Joined: Thu Oct 13, 2005 3:41 pm
Location: Quebec City, Canada

Postby toninhofwi » Wed Nov 29, 2006 11:23 am

Marc Boissinot wrote:Here's a try for mdi child windows inside a mdi frame.


Marc, works fine. Is just that I need, thanks.

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 54 guests