47 lines
974 B
C++
47 lines
974 B
C++
// 16 august 2015
|
|
#include "uipriv_wpf.hpp"
|
|
|
|
static uintmax_t type_uiWindowsControl = 0;
|
|
|
|
uintmax_t uiWindowsControlType(void)
|
|
{
|
|
if (type_uiWindowsControl == 0)
|
|
type_uiWindowsControl = uiRegisterType("uiWindowsControl", uiControlType(), sizeof (uiWindowsControl));
|
|
return type_uiWindowsControl;
|
|
}
|
|
|
|
UIElement ^genericHandle(uiControl *c)
|
|
{
|
|
gcroot<UIElement ^> *h;
|
|
|
|
h = (gcroot<UIElement ^> *) uiControlHandle(c);
|
|
return *h;
|
|
}
|
|
|
|
static void defaultCommitShow(uiControl *c)
|
|
{
|
|
genericHandle(c)->Visibility = Visibility::Visible;
|
|
}
|
|
|
|
static void defaultCommitHide(uiControl *c)
|
|
{
|
|
// TODO formally document this behavior (it's how GTK+ works)
|
|
genericHandle(c)->Visibility = Visibility::Collapsed;
|
|
}
|
|
|
|
void osCommitEnable(uiControl *c)
|
|
{
|
|
genericHandle(c)->IsEnabled = true;
|
|
}
|
|
|
|
void osCommitDisable(uiControl *c)
|
|
{
|
|
genericHandle(c)->IsEnabled = false;
|
|
}
|
|
|
|
void uiWindowsFinishControl(uiControl *c)
|
|
{
|
|
c->CommitShow = defaultCommitShow;
|
|
c->CommitHide = defaultCommitHide;
|
|
}
|