mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 09:51:22 +00:00
[uxtheme]
- Use double buffering when painting the caption svn path=/branches/GSoC_2011/ThemesSupport/; revision=52544
This commit is contained in:
parent
47f499522a
commit
29e5fe2299
1 changed files with 30 additions and 0 deletions
|
@ -26,6 +26,10 @@ typedef struct _DRAW_CONTEXT
|
||||||
BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */
|
BOOL Active; /* wi.dwWindowStatus isn't correct for mdi child windows */
|
||||||
HRGN hRgn;
|
HRGN hRgn;
|
||||||
int CaptionHeight;
|
int CaptionHeight;
|
||||||
|
|
||||||
|
/* for double buffering */
|
||||||
|
HDC hDCScreen;
|
||||||
|
HBITMAP hbmpOld;
|
||||||
} DRAW_CONTEXT, *PDRAW_CONTEXT;
|
} DRAW_CONTEXT, *PDRAW_CONTEXT;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -59,6 +63,7 @@ typedef enum {
|
||||||
|
|
||||||
#define BUTTON_GAP_SIZE 2
|
#define BUTTON_GAP_SIZE 2
|
||||||
|
|
||||||
|
#define MENU_BAR_ITEMS_SPACE (12)
|
||||||
|
|
||||||
HFONT hMenuFont = NULL;
|
HFONT hMenuFont = NULL;
|
||||||
HFONT hMenuFontBold = NULL;
|
HFONT hMenuFontBold = NULL;
|
||||||
|
@ -234,6 +239,29 @@ ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ThemeStartBufferedPaint(PDRAW_CONTEXT pcontext, int cx, int cy)
|
||||||
|
{
|
||||||
|
HBITMAP hbmp;
|
||||||
|
|
||||||
|
pcontext->hDCScreen = pcontext->hDC;
|
||||||
|
pcontext->hDC = CreateCompatibleDC(pcontext->hDCScreen);
|
||||||
|
hbmp = CreateCompatibleBitmap(pcontext->hDCScreen, cx, cy);
|
||||||
|
pcontext->hbmpOld = (HBITMAP)SelectObject(pcontext->hDC, hbmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ThemeEndBufferedPaint(PDRAW_CONTEXT pcontext, int x, int y, int cx, int cy)
|
||||||
|
{
|
||||||
|
HBITMAP hbmp;
|
||||||
|
BitBlt(pcontext->hDCScreen, 0, 0, cx, cy, pcontext->hDC, x, y, SRCCOPY);
|
||||||
|
hbmp = (HBITMAP) SelectObject(pcontext->hDC, pcontext->hbmpOld);
|
||||||
|
DeleteObject(pcontext->hDC);
|
||||||
|
DeleteObject(hbmp);
|
||||||
|
|
||||||
|
pcontext->hDC = pcontext->hDCScreen;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
|
ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
|
||||||
RECT* prcCurrent,
|
RECT* prcCurrent,
|
||||||
|
@ -663,7 +691,9 @@ ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
|
||||||
|
|
||||||
if((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION)
|
if((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION)
|
||||||
{
|
{
|
||||||
|
ThemeStartBufferedPaint(pcontext, prcCurrent->right, pcontext->CaptionHeight);
|
||||||
ThemeDrawCaption(pcontext, prcCurrent);
|
ThemeDrawCaption(pcontext, prcCurrent);
|
||||||
|
ThemeEndBufferedPaint(pcontext, 0, 0, prcCurrent->right, pcontext->CaptionHeight);
|
||||||
ThemeDrawBorders(pcontext, prcCurrent);
|
ThemeDrawBorders(pcontext, prcCurrent);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue