uiBox *makePage10(void) { uiBox *page10; uiBox *vbox; uiBox *hbox; page10 = newVerticalBox(); vbox = page10; hbox = newHorizontalBox(); uiBoxAppend(vbox, uiControl(hbox), 0); textString = uiNewEntry(); // TODO make it placeholder uiEntrySetText(textString, "Enter text here"); uiBoxAppend(hbox, uiControl(textString), 1); textFontButton = uiNewFontButton(); uiFontButtonOnChanged(textFontButton, onFontChanged, NULL); uiBoxAppend(hbox, uiControl(textFontButton), 1); textColorButton = uiNewColorButton(); uiColorButtonOnChanged(textColorButton, onColorChanged, NULL); uiBoxAppend(hbox, uiControl(textColorButton), 1); hbox = newHorizontalBox(); uiBoxAppend(vbox, uiControl(hbox), 0); textApply = uiNewButton("Apply"); uiBoxAppend(hbox, uiControl(textApply), 1); textWidth = uiNewEntry(); uiEntrySetText(textWidth, "-1"); uiBoxAppend(hbox, uiControl(textWidth), 1); noZ = uiNewCheckbox("No Z Color"); uiCheckboxOnToggled(noZ, onNoZ, NULL); uiBoxAppend(hbox, uiControl(noZ), 0); textAreaHandler.Draw = handlerDraw; textAreaHandler.MouseEvent = handlerMouseEvent; textAreaHandler.MouseCrossed = handlerMouseCrossed; textAreaHandler.DragBroken = handlerDragBroken; textAreaHandler.KeyEvent = handlerKeyEvent; textArea = uiNewArea(&textAreaHandler); uiBoxAppend(vbox, uiControl(textArea), 1); // dummy objects to test single-activation hbox = newHorizontalBox(); uiBoxAppend(vbox, uiControl(hbox), 0); uiBoxAppend(hbox, uiControl(uiNewFontButton()), 1); uiBoxAppend(hbox, uiControl(uiNewColorButton()), 1); return page10; }
uiColorButton *uiNewColorButton(void) { uiColorButton *b; uiWindowsNewControl(uiColorButton, b); // initial color is black b->r = 0.0; b->g = 0.0; b->b = 0.0; b->a = 1.0; b->hwnd = uiWindowsEnsureCreateControlHWND(0, L"button", L" ", // TODO; can't use "" TODO BS_PUSHBUTTON | WS_TABSTOP, hInstance, NULL, TRUE); uiWindowsRegisterWM_COMMANDHandler(b->hwnd, onWM_COMMAND, uiControl(b)); uiWindowsRegisterWM_NOTIFYHandler(b->hwnd, onWM_NOTIFY, uiControl(b)); uiColorButtonOnChanged(b, defaultOnChanged, NULL); return b; }