|
From: <ss...@ma...> - 2012-06-20 12:37:24
|
Sorry!! Lost function about PaintWindow() and nOr()
//---------------------------------------------------------------------
HB_FUNC( NOR )
{
LONG lRet = 0;
DWORD i = 0;
while( i < hb_pcount() )
lRet |= ( LONG ) hb_parnl( ++i );
hb_retnl( lRet );
}
//---------------------------------------------------------------------
FUNC PaintWindow( oWin, wParam )
Local aRect := GetClientRect( oWin:handle )
Local aPos := ClientToScreen( oWin:handle )
Local nHPixel := aRect[4],;
nVPixel := aRect[3]
Local oBmp := HBitmap():AddFile( 'hwgui.bmp' )
Local pps, hDC
Local nY := 0,;
nX := 0
//
pps := DefinePaintStru()
hDC := BeginPaint( oWin:handle, pps )
// bug: must repaint first image again
DrawBitmap( hDC, oBmp:handle,, aPos[1], aPos[2], oBmp:nWidth, oBmp:nHeight )
UpdateWindow( oWin:handle )
If oBmp:nWidth > 0
For nX := 0 To nHPixel+(oBmp:nWidth) Step oBmp:nWidth
For nY := 0 To nVPixel+(oBmp:nHeight) Step oBmp:nHeight
DrawBitmap( hDC, oBmp:handle,, nX+aPos[1], nY+aPos[2], oBmp:nWidth, oBmp:nHeight )
UpdateWindow( oWin:handle )
Next nX
Next nY
EndIf
EndPaint( oWin:handle, pps )
RETURN -1
//---------------------------------------------------------------------
> Hi!
>
> Can't compile your sample,
>
> Generating C source output to 'd:\tmp\hbmk_j2u5s6.dir\a1.c'... Done.
> d:/tmp/hbmk_j2u5s6.dir/a1.o:a1.c:(.data+0x68): undefined reference to
> `HB_FUN_NOR'
> d:/tmp/hbmk_j2u5s6.dir/a1.o:a1.c:(.data+0x78): undefined reference to
> `HB_FUN_PAINTWINDOW'
> collect2: ld returned 1 exit status
>
> Regards,
> Alexey Myronenko
>
>
> Hi All!
>
> I found a bug about MDICHILD WINDOW,
> When I use mouse to move MDICHILD WINDOW and background image have not
> repaint.
>
> //---------------------------------------------------------------------
> #include "hbclass.ch"
> #include "guilib.ch"
> #include "windows.ch"
>
> Func Main()
> Local oWnd, oMenu
> INIT WINDOW oWnd MAIN MDI AT 0,0 SIZE 800, 600;
> COLOR HBrush():Add(16744703):handle;
> TITLE "Test MDI Windows";
> STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_VISIBLE );
> ON PAINT {|o,w| PaintWindow(o,w) }
>
> MENU OF oWnd
> MENU TITLE "[&A]Test"
> MENUITEM "[&A]MDI Child Window" ACTION Test2(oWnd)
> ENDMENU
> ENDMENU
>
> ACTIVATE WINDOW oWnd MAXIMIZED
> Return NIL
>
> Func Test2(oWnd)
> Local oChild
> INIT WINDOW oChild MDICHILD OF oWnd TITLE 'MDICHILD Window';
> AT 200,0 SIZE 500,400;
> STYLE WS_VISIBLE + WS_OVERLAPPEDWINDOW
> ACTIVATE WINDOW oChild
> RETURN NIL
> //---------------------------------------------------------------------
>
> Image1(MAIN MDI Window):http://img266.imageshack.us/img266/9954/image21t.jpg
> Image2(Open MDICHILD Window):http://img593.imageshack.us/img593/3594/image22hh.jpg
> Image3(Use Mouse to Move MDICHILD and background have not repaint):http://img163.imageshack.us/img163/15/image23q.jpg
>
> ps. ONLY 'MDICHILD Window' not repaint, DIALOG/DIALOG NOMODAL/WINDOW
> CHILD have repaint.
>
>
> XP SP2/Chinese
> harbour 3.0
> HWGUI last svn -DUNICODE
> borland C++ 5.5.1
>
|