Added another facet to page 10's tests: whether the letter after the combined one gets colored.
This commit is contained in:
parent
0b7b9a94e7
commit
3896861f39
|
@ -1,14 +1,12 @@
|
||||||
// 22 december 2015
|
// 22 december 2015
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
// TODO change addLeading into a checkbox for colorizing that one z
|
|
||||||
|
|
||||||
static uiEntry *textString;
|
static uiEntry *textString;
|
||||||
static uiFontButton *textFontButton;
|
static uiFontButton *textFontButton;
|
||||||
static uiColorButton *textColorButton;
|
static uiColorButton *textColorButton;
|
||||||
static uiEntry *textWidth;
|
static uiEntry *textWidth;
|
||||||
static uiButton *textApply;
|
static uiButton *textApply;
|
||||||
static uiCheckbox *addLeading;
|
static uiCheckbox *noZ;
|
||||||
static uiArea *textArea;
|
static uiArea *textArea;
|
||||||
static uiAreaHandler textAreaHandler;
|
static uiAreaHandler textAreaHandler;
|
||||||
|
|
||||||
|
@ -84,9 +82,10 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *dp)
|
||||||
uiDrawTextLayoutSetColor(layout,
|
uiDrawTextLayoutSetColor(layout,
|
||||||
5, 6,
|
5, 6,
|
||||||
1, 0, 0.5, 0.5);
|
1, 0, 0.5, 0.5);
|
||||||
uiDrawTextLayoutSetColor(layout,
|
if (!uiCheckboxChecked(noZ))
|
||||||
6, 7,
|
uiDrawTextLayoutSetColor(layout,
|
||||||
0.5, 0, 1, 0.5);
|
6, 7,
|
||||||
|
0.5, 0, 1, 0.5);
|
||||||
uiDrawText(dp->Context, 10, 10 + height + height, layout);
|
uiDrawText(dp->Context, 10, 10 + height + height, layout);
|
||||||
uiDrawFreeTextLayout(layout);
|
uiDrawFreeTextLayout(layout);
|
||||||
|
|
||||||
|
@ -124,7 +123,7 @@ static void onColorChanged(uiColorButton *b, void *data)
|
||||||
uiAreaQueueRedrawAll(textArea);
|
uiAreaQueueRedrawAll(textArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void onTextApply(uiButton *b, void *data)
|
static void onNoZ(uiCheckbox *b, void *data)
|
||||||
{
|
{
|
||||||
uiAreaQueueRedrawAll(textArea);
|
uiAreaQueueRedrawAll(textArea);
|
||||||
}
|
}
|
||||||
|
@ -158,16 +157,15 @@ uiBox *makePage10(void)
|
||||||
uiBoxAppend(vbox, uiControl(hbox), 0);
|
uiBoxAppend(vbox, uiControl(hbox), 0);
|
||||||
|
|
||||||
textApply = uiNewButton("Apply");
|
textApply = uiNewButton("Apply");
|
||||||
uiButtonOnClicked(textApply, onTextApply, NULL);
|
|
||||||
uiBoxAppend(hbox, uiControl(textApply), 1);
|
uiBoxAppend(hbox, uiControl(textApply), 1);
|
||||||
|
|
||||||
textWidth = uiNewEntry();
|
textWidth = uiNewEntry();
|
||||||
uiEntrySetText(textWidth, "-1");
|
uiEntrySetText(textWidth, "-1");
|
||||||
uiBoxAppend(hbox, uiControl(textWidth), 1);
|
uiBoxAppend(hbox, uiControl(textWidth), 1);
|
||||||
|
|
||||||
addLeading = uiNewCheckbox("Add Leading");
|
noZ = uiNewCheckbox("No Z Color");
|
||||||
uiCheckboxSetChecked(addLeading, 1);
|
uiCheckboxOnToggled(noZ, onNoZ, NULL);
|
||||||
uiBoxAppend(hbox, uiControl(addLeading), 0);
|
uiBoxAppend(hbox, uiControl(noZ), 0);
|
||||||
|
|
||||||
textAreaHandler.Draw = handlerDraw;
|
textAreaHandler.Draw = handlerDraw;
|
||||||
textAreaHandler.MouseEvent = handlerMouseEvent;
|
textAreaHandler.MouseEvent = handlerMouseEvent;
|
||||||
|
|
Loading…
Reference in New Issue