Started properly handling uiControl functions in uiTab and tabPage. Removed a few stale TODOs as well.
This commit is contained in:
parent
d9c209e524
commit
bc4ac108ce
|
@ -2,7 +2,6 @@
|
||||||
#include "uipriv_windows.h"
|
#include "uipriv_windows.h"
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// - comctl5 on real windows: tabs get drawn behind checkbox
|
|
||||||
// - container update state
|
// - container update state
|
||||||
|
|
||||||
struct tab {
|
struct tab {
|
||||||
|
@ -56,8 +55,16 @@ static BOOL onWM_NOTIFY(uiControl *c, HWND hwnd, NMHDR *nm, LRESULT *lResult)
|
||||||
static void tabCommitDestroy(uiControl *c)
|
static void tabCommitDestroy(uiControl *c)
|
||||||
{
|
{
|
||||||
struct tab *t = (struct tab *) c;
|
struct tab *t = (struct tab *) c;
|
||||||
|
uiControl *page;
|
||||||
|
|
||||||
// TODO
|
while (t->pages->len != 0) {
|
||||||
|
page = ptrArrayIndex(t->pages, uiControl *, 0);
|
||||||
|
ptrArrayDelete(t->pages, 0);
|
||||||
|
// TODO destroy control
|
||||||
|
uiControlSetParent(page, NULL);
|
||||||
|
uiControlDestroy(page);
|
||||||
|
}
|
||||||
|
ptrArrayDestroy(t->pages);
|
||||||
uiWindowsUnregisterWM_NOTIFYHandler(t->hwnd);
|
uiWindowsUnregisterWM_NOTIFYHandler(t->hwnd);
|
||||||
(*(t->baseCommitDestroy))(uiControl(t));
|
(*(t->baseCommitDestroy))(uiControl(t));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,7 @@
|
||||||
// This is a special internal control type that handles tab pages.
|
// This is a special internal control type that handles tab pages.
|
||||||
// This doesn't use the container class, but rather a subclassed WC_DIALOG, as that supports tab textures properly.
|
// This doesn't use the container class, but rather a subclassed WC_DIALOG, as that supports tab textures properly.
|
||||||
// The standard property sheet control oes the same thing.
|
// The standard property sheet control oes the same thing.
|
||||||
// TODO (long term) figure out how to use uiContainer with this
|
|
||||||
|
|
||||||
// TODO verify that the tab page texture doesn't end too soon
|
|
||||||
// TODO container update state
|
|
||||||
// TODO tell wine that dialogs respond to WM_PRINTCLIENT on xp+
|
// TODO tell wine that dialogs respond to WM_PRINTCLIENT on xp+
|
||||||
|
|
||||||
struct tabPage {
|
struct tabPage {
|
||||||
|
@ -20,8 +17,7 @@ struct tabPage {
|
||||||
|
|
||||||
uiDefineControlType(tabPage, tabPageType, struct tabPage)
|
uiDefineControlType(tabPage, tabPageType, struct tabPage)
|
||||||
|
|
||||||
// TODO override methods
|
// don't override CommitDestroy(); we destroy the child with a separate function
|
||||||
// TODO when overriding CommitDestroy, DO NOT DESTROY THE CHILD
|
|
||||||
|
|
||||||
static uintptr_t tabPageHandle(uiControl *c)
|
static uintptr_t tabPageHandle(uiControl *c)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +29,8 @@ static uintptr_t tabPageHandle(uiControl *c)
|
||||||
// from http://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
|
// from http://msdn.microsoft.com/en-us/library/windows/desktop/bb226818%28v=vs.85%29.aspx
|
||||||
#define tabMargin 7
|
#define tabMargin 7
|
||||||
|
|
||||||
|
// TODO preferred size
|
||||||
|
|
||||||
static void tabPageResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height, uiSizing *d)
|
static void tabPageResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height, uiSizing *d)
|
||||||
{
|
{
|
||||||
struct tabPage *t = (struct tabPage *) c;
|
struct tabPage *t = (struct tabPage *) c;
|
||||||
|
@ -59,6 +57,8 @@ static void tabPageResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width,
|
||||||
uiFreeSizing(dchild);
|
uiFreeSizing(dchild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO container update state
|
||||||
|
|
||||||
// dummy dialog function; see below for details
|
// dummy dialog function; see below for details
|
||||||
INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
INT_PTR CALLBACK dlgproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -80,7 +80,6 @@ uiControl *newTabPage(uiControl *child)
|
||||||
if (t->hwnd == NULL)
|
if (t->hwnd == NULL)
|
||||||
logLastError("error creating tab page in newTabPage()");
|
logLastError("error creating tab page in newTabPage()");
|
||||||
|
|
||||||
// TODO figure out why this is not working
|
|
||||||
hr = EnableThemeDialogTexture(t->hwnd, ETDT_ENABLE | ETDT_USETABTEXTURE | ETDT_ENABLETAB);
|
hr = EnableThemeDialogTexture(t->hwnd, ETDT_ENABLE | ETDT_USETABTEXTURE | ETDT_ENABLETAB);
|
||||||
if (hr != S_OK)
|
if (hr != S_OK)
|
||||||
logHRESULT("error setting tab page background in newTabPage()", hr);
|
logHRESULT("error setting tab page background in newTabPage()", hr);
|
||||||
|
|
Loading…
Reference in New Issue