Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Window not repainted

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Window not repainted
#13306
Posted by: chucksim 2010-04-14 20:21:07
I have a window where I paint the background a custom color. When I use the guisay popup window, the background color of my window turns to gray as i move the guisay window around. When the guisay window if closed, my background is grayed and is not redrawn. It's as if it is getting erased but not repainted.

My scripts contains the following:

DO
        /* Define functions for paining windows */
        FUNCDEF("CreateSolidBrush", "32u, 32u", "gdi32")
        FUNCDEF("SelectObject", "32u, 32u, 32u", "gdi32")
        rect = "32u, 32u, 32u, 32u"
        FUNCDEF("FillRect", ", 32u, struct RECT, 32u", "user32")
        FUNCDEF("DeleteBrush", ", 32u", "gdi32", "DeleteObject")


        /* Register GetStockObject so we can grab one of the preset brushes for drawing text. */
        FUNCDEF("GetStockObject", "void, 32u", "gdi32")

        /* Register SetBkColor so we can change the background color for text. */
        FUNCDEF("SetBkColor", "32u, void, 32u", "gdi32")

        /* Register SetTextColor so we can change the foreground color for text. */
        FUNCDEF("SetTextColor", "32u, void, 32u", "gdi32")

        /* Register Paint so I can show my pretty logos */
        paintstruct = "32u, 32u, 32, 32, 32, 32, 32u, 32u, char[32]"
        FUNCDEF("BeginPaint", "32u, void, struct PAINTSTRUCT stor", "user32")
        FUNCDEF("EndPaint", "32, void, struct PAINTSTRUCT", "user32")

        CATCH FAILURE

                CONDITION("M")
                RETURN
END

...



wm_erasebkgnd:

    context = ARG(1)
    guigetctlplacement(guiwindow, , , 'Width', 'Height')
    temp = selectobject(context, brush)
    rect.1 = 0
    rect.2 = 0
    rect.3 = width
    rect.4 = height
    fillrect(context, rect, brush)
    selectobject(context, temp)
    RETURN 1



/* Called when the window needs to be redrawn. */
WM_PAINT:
        /* Erase the background and get a device context */
        hdc = BeginPaint(GuiWindow, ps)

        DO

                /* Draw the picture object at an XY position of (136, 38) */
                IF EXISTS("PicObject") THEN GuiPicture("PicObject", hdc, 400,15)

                FINALLY
                        /* End paint */
                        EndPaint(GuiWindow, ps)
        END

        /* Don't let Rexx Gui process this event. */
        RETURN ""
Chuck Simmons
Message2.
#13309
Posted by: Jeff Glatt 2010-04-18 23:15:00
Force a redraw of the window. Follow the call to Guisay with:
guirefresh()
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0