本文整理汇总了C++中GUI_CreateLabelBox函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_CreateLabelBox函数的具体用法?C++ GUI_CreateLabelBox怎么用?C++ GUI_CreateLabelBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_CreateLabelBox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PAGE_SwashInit
void PAGE_SwashInit(int page)
{
(void)page;
PAGE_SetActionCB(_action_cb);
PAGE_SetModal(0);
PAGE_RemoveAllObjects();
get_swash();
u8 w = 60;
u8 x = 63;
PAGE_ShowHeader(_tr("SwashType"));
GUI_CreateTextSelectPlate(&gui->type, x-3, 0, w + 8, LINE_HEIGHT - 1, &DEFAULT_FONT, NULL, swash_val_cb, NULL); // FIXME: need a special value for header button/textsels
u8 row = LINE_SPACE;
GUI_CreateLabelBox(&gui->lbl[0], 0, row, 0, LINE_HEIGHT, &DEFAULT_FONT, NULL, NULL, _tr("ELE Mix"));
GUI_CreateTextSelectPlate(&gui->mix[0], x, row, w, LINE_HEIGHT, &DEFAULT_FONT, NULL, swashmix_val_cb, (void *)1);
row += LINE_SPACE;
GUI_CreateLabelBox(&gui->lbl[1], 0, row, 0, LINE_HEIGHT, &DEFAULT_FONT, NULL, NULL, _tr("AIL Mix"));
GUI_CreateTextSelectPlate(&gui->mix[1], x, row, w, LINE_HEIGHT, &DEFAULT_FONT, NULL, swashmix_val_cb, (void *)0);
row += LINE_SPACE;
GUI_CreateLabelBox(&gui->lbl[2], 0, row, 0, LINE_HEIGHT, &DEFAULT_FONT, NULL, NULL, _tr("PIT Mix"));
GUI_CreateTextSelectPlate(&gui->mix[2], x, row, w, LINE_HEIGHT, &DEFAULT_FONT, NULL, swashmix_val_cb, (void *)2);
update_swashmixes();
GUI_Select1stSelectableObj();
}
示例2: PAGE_TelemconfigInit
void PAGE_TelemconfigInit(int page)
{
(void)page;
enum {
COL1 = (10 + ((LCD_WIDTH - 320) / 2)),
COL2 = (COL1 + 55),
COL3 = (COL1 + 156),
COL4 = (COL1 + 225),
ROW1 = (70 + ((LCD_HEIGHT - 240) / 2)),
};
const u8 row_height = 25;
PAGE_SetModal(0);
#if HAS_STANDARD_GUI
if (Model.mixer_mode == MIXER_STANDARD)
PAGE_ShowHeader_ExitOnly(PAGE_GetName(PAGEID_TELEMCFG), MODELMENU_Show);
else
#endif
PAGE_ShowHeader(PAGE_GetName(PAGEID_TELEMCFG));
if (telem_state_check() == 0) {
GUI_CreateLabelBox(&gui->msg, 20, 80, 280, 100, &NARROW_FONT, NULL, NULL, tempstring);
return;
}
for (long i = 0; i < TELEM_NUM_ALARMS; i++) {
GUI_CreateLabelBox(&gui->name[i], COL1, ROW1 + row_height * i, 55, 16, &DEFAULT_FONT,
label_cb, NULL, (void *)i);
GUI_CreateTextSelect(&gui->type[i], COL2, ROW1 + row_height * i, TEXTSELECT_96, NULL, telem_name_cb, (void *)i);
GUI_CreateTextSelect(&gui->gtlt[i], COL3, ROW1 + row_height * i, TEXTSELECT_64, NULL, gtlt_cb, (void *)i);
GUI_CreateTextSelect(&gui->value[i], COL4, ROW1 + row_height * i, TEXTSELECT_64, NULL, limit_cb, (void *)i);
}
}
示例3: row_cb
static int row_cb(int absrow, int relrow, int y, void *data)
{
int row_count = (long)data;
struct LabelDesc listbox = {
.font = DEFAULT_FONT.font,
.style = LABEL_LISTBOX,
.font_color = DEFAULT_FONT.font_color,
.fill_color = DEFAULT_FONT.fill_color,
.outline_color = DEFAULT_FONT.outline_color
};
if (absrow >= row_count) {
GUI_CreateLabelBox(&gui->label[relrow], LCD_WIDTH/2-100, y,
200 - ARROW_WIDTH, LINE_HEIGHT, &listbox, NULL, NULL, "");
} else {
GUI_CreateLabelBox(&gui->label[relrow], LCD_WIDTH/2-100, y,
200 - ARROW_WIDTH, LINE_HEIGHT, &listbox, string_cb, press_cb, (void *)(long)absrow);
}
return 1;
}
void PAGE_LanguageInit(int page)
{
(void)page;
int num_lang = count_num_languages();
PAGE_ShowHeader(_tr(PAGE_GetName(PAGEID_LANGUAGE)));
int min_rows = num_lang >= LISTBOX_ITEMS ? num_lang : LISTBOX_ITEMS;
GUI_CreateScrollable(&gui->scrollable, LCD_WIDTH/2-100, 40, 200, LISTBOX_ITEMS * LINE_HEIGHT, LINE_HEIGHT, min_rows, row_cb, NULL, NULL, (void *)(long)num_lang);
GUI_SetSelected(GUI_ShowScrollableRowCol(&gui->scrollable, Transmitter.language, 0));
}
示例4: PAGE_DrExpInit
void PAGE_DrExpInit(int page)
{
(void)page;
enum {
COL3 = (4 + ((LCD_WIDTH - 320) / 2)),
COL4 = (112 + ((LCD_WIDTH - 320) / 2)),
COL5 = (216 + ((LCD_WIDTH - 320) / 2)),
COL1 = COL4,
COL2 = (COL1 + 32),
ROW1 = (36 + ((LCD_HEIGHT - 240) / 2)),
ROW2 = (ROW1 + 20),
ROW3 = (ROW1 + 40),
ROW4 = (ROW1 + 60),
ROW5 = (ROW1 + 80),
};
PAGE_ShowHeader_ExitOnly(PAGE_GetName(PAGEID_DREXP), MODELMENU_Show);
PAGE_ShowHeader_ExitOnly(NULL, MODELMENU_Show);
PAGE_ShowHeader_SetLabel(STDMIX_TitleString, SET_TITLE_DATA(PAGEID_DREXP, SWITCHFUNC_DREXP_AIL+drexp_type));
memset(mp, 0, sizeof(*mp));
int count = get_mixers();
int expected = INPUT_NumSwitchPos(mapped_std_channels.switches[SWITCHFUNC_DREXP_AIL+drexp_type]);
if (count != expected) {
GUI_CreateLabelBox(&gui->msg, 0, 120, 240, 16, &NARROW_FONT, NULL, NULL, "Invalid model ini!");// must be invalid model ini
return;
}
/* Row 1 */
GUI_CreateLabelBox(&gui->srclbl, COL1, ROW1, 96, 16, &DEFAULT_FONT, NULL, NULL, _tr("Src"));
GUI_CreateTextSelect(&gui->src, COL2, ROW1, TEXTSELECT_64, NULL, set_type_cb, NULL);
/* Row 2 */
GUI_CreateLabelBox(&gui->mode[0], COL3, ROW2, 96, 16, &DEFAULT_FONT, NULL, NULL, STDMIX_ModeName(PITTHROMODE_NORMAL));
GUI_CreateLabelBox(&gui->mode[1], COL4, ROW2, 96, 16, &DEFAULT_FONT, NULL, NULL, STDMIX_ModeName(PITTHROMODE_IDLE1));
GUI_CreateLabelBox(&gui->mode[2], COL5, ROW2, 96, 16, &DEFAULT_FONT, NULL, NULL, STDMIX_ModeName(PITTHROMODE_IDLE2));
/* Row 3 */
GUI_CreateTextSelect(&gui->dr[0], COL3, ROW3, TEXTSELECT_96, NULL, set_dr_cb, ((void *)(long)PITTHROMODE_NORMAL));
GUI_CreateTextSelect(&gui->dr[1], COL4, ROW3, TEXTSELECT_96, NULL, set_dr_cb, ((void *)(long)PITTHROMODE_IDLE1));
GUI_CreateTextSelect(&gui->dr[2], COL5, ROW3, TEXTSELECT_96, NULL, set_dr_cb, ((void *)(long)PITTHROMODE_IDLE2));
/* Row 4 */
GUI_CreateTextSelect(&gui->exp[0], COL3, ROW4, TEXTSELECT_96, NULL, set_exp_cb, ((void *)(long)PITTHROMODE_NORMAL));
GUI_CreateTextSelect(&gui->exp[1], COL4, ROW4, TEXTSELECT_96, NULL, set_exp_cb, ((void *)(long)PITTHROMODE_IDLE1));
GUI_CreateTextSelect(&gui->exp[2], COL5, ROW4, TEXTSELECT_96, NULL, set_exp_cb, ((void *)(long)PITTHROMODE_IDLE2));
/* Row 5 */
u16 ymax = CHAN_MAX_VALUE/100 * MAX_SCALAR;
s16 ymin = -ymax;
GUI_CreateXYGraph(&gui->graph[0], COL3, ROW5, 96, 120,
CHAN_MIN_VALUE, ymin,
CHAN_MAX_VALUE, ymax,
0, 0, show_curve_cb, curpos_cb, NULL, (void *)(PITTHROMODE_NORMAL+1L));
GUI_CreateXYGraph(&gui->graph[1], COL4, ROW5, 96, 120,
CHAN_MIN_VALUE, ymin,
CHAN_MAX_VALUE, ymax,
0, 0, show_curve_cb, curpos_cb, NULL, (void *)(PITTHROMODE_IDLE1+1L));
GUI_CreateXYGraph(&gui->graph[2], COL5, ROW5, 96, 120,
CHAN_MIN_VALUE, ymin,
CHAN_MAX_VALUE, ymax,
0, 0, show_curve_cb, curpos_cb, NULL, (void *)(PITTHROMODE_IDLE2+1L));
_refresh_page();
}
示例5: calibrate_touch
static void calibrate_touch(void)
{
if (cp->state == 0 || cp->state == 3) {
if (GUI_ObjectNeedsRedraw((guiObject_t *)&guic->msg))
return;
draw_target(cp->state ? LCD_WIDTH - XCOORD : XCOORD , cp->state ? LCD_HEIGHT - YCOORD : YCOORD + 32);
cp->state++;
} else if (cp->state == 1 || cp->state == 4) {
if (SPITouch_IRQ()) {
cp->coords = SPITouch_GetCoords();
cp->state++;
}
} else if (cp->state == 2) {
if (! SPITouch_IRQ()) {
cp->coords1 = cp->coords;
GUI_RemoveObj((guiObject_t *)&guic->msg);
GUI_CreateLabelBox(&guic->msg, LCD_WIDTH - XCOORD - 5, LCD_HEIGHT - YCOORD - 5,
11, 11, &SMALLBOX_FONT, NULL, NULL, "");
GUI_Redraw(&guic->msg1);
cp->state = 3;
} else {
cp->coords = SPITouch_GetCoords();
}
} else if (cp->state == 5) {
if (! SPITouch_IRQ()) {
s32 xscale, yscale;
s32 xoff, yoff;
printf("T1:(%d, %d)\n", cp->coords1.x, cp->coords1.y);
printf("T2:(%d, %d)\n", cp->coords.x, cp->coords.y);
xscale = cp->coords.x - cp->coords1.x;
xscale = (LCD_WIDTH - 2 * XCOORD) * 0x10000 / xscale;
yscale = cp->coords.y - cp->coords1.y;
yscale = (LCD_HEIGHT - 32 - 2 * YCOORD) * 0x10000 / yscale;
xoff = XCOORD - cp->coords1.x * xscale / 0x10000;
yoff = YCOORD + 32 - cp->coords1.y * yscale / 0x10000;
printf("Debug: scale(%d, %d) offset(%d, %d)\n", (int)xscale, (int)yscale, (int)xoff, (int)yoff);
SPITouch_Calibrate(xscale, yscale, xoff, yoff);
PAGE_RemoveAllObjects();
PAGE_SetModal(1);
PAGE_ShowHeader_ExitOnly(_tr("Touch Test"), okcancel_cb);
GUI_CreateLabelBox(&guic->msg, (LCD_WIDTH - 150) / 2, (LCD_HEIGHT - 25) / 2, 150, 25, &SMALLBOX_FONT, coords_cb, NULL, NULL);
memset(&cp->coords, 0, sizeof(cp->coords));
cp->state = 6;
} else {
cp->coords = SPITouch_GetCoords();
}
} else if(cp->state == 6) {
struct touch t;
if (SPITouch_IRQ()) {
t = SPITouch_GetCoords();
if (memcmp(&t, &cp->coords, sizeof(t)) != 0) {
cp->coords = t;
GUI_Redraw(&guic->msg);
}
}
}
}
示例6: Reset
/* Advanced Standard
Row1 Timer Timer
Row2 Switch Switch
Row3 Reset(perm)/ResetSwitch Reset(perm)/Start
Row4 Start/Set-to Set-to
*/
static int row_cb(int absrow, int relrow, int y, void *data)
{
(void)data;
(void)relrow;
u8 space = LINE_SPACE;
//Row 1
GUI_CreateLabelBox(&gui->name, LABEL_X, y,
LABEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT, timer_str_cb, NULL, (void *)(long)absrow);
GUI_CreateTextSelectPlate(&gui->type, TEXTSEL_X, y,
TEXTSEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT, NULL, set_timertype_cb, (void *)(long)absrow);
//Row 2
y += space;
GUI_CreateLabelBox(&gui->switchlbl, LABEL_X, y,
LABEL_WIDTH, LINE_HEIGHT,&DEFAULT_FONT, switch_str_cb, NULL, (void *)(long)absrow);
GUI_CreateTextSourcePlate(&gui->src, TEXTSEL_X, y,
TEXTSEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT, toggle_source_cb, set_source_cb, set_input_source_cb, (void *)(long)absrow);
//Row 3
y += space;
/*prem-timer reset */
GUI_CreateLabelBox(&gui->resetpermlbl, LABEL_X, y ,
LABEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT, NULL, NULL, _tr("Reset"));
GUI_CreateButtonPlateText(&gui->resetperm, RESET_X, y ,
RESET_WIDTH, LINE_HEIGHT,&DEFAULT_FONT, show_timerperm_cb, 0x0000, reset_timerperm_cb,(void *)(long)absrow);
if(Model.mixer_mode != MIXER_STANDARD) {
/* or Reset switch */
GUI_CreateLabelBox(&gui->resetlbl, LABEL_X, y ,
LABEL_WIDTH, LINE_HEIGHT,&DEFAULT_FONT, NULL, NULL, _tr("Reset sw"));
GUI_CreateTextSourcePlate(&gui->resetsrc, TEXTSEL_X, y ,
TEXTSEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT, toggle_resetsrc_cb, set_resetsrc_cb, set_input_rstsrc_cb, (void *)(long)absrow);
y += space;
}
//Row 4
GUI_CreateLabelBox(&gui->startlbl, LABEL_X, y,
START_WIDTH, // bug fix: label width and height can't be 0, otherwise, the label couldn't be hidden dynamically
LINE_HEIGHT, &DEFAULT_FONT, NULL, NULL, _tr("Start"));
GUI_CreateTextSelectPlate(&gui->start, TEXTSEL_X, y,
TEXTSEL_WIDTH, LINE_HEIGHT, &DEFAULT_FONT,NULL, set_start_cb, (void *)(long)absrow);
// don't include this in Devo7e due to memory restrictions
#if HAS_PERMANENT_TIMER
if(Model.mixer_mode == MIXER_STANDARD)
y+= space;
GUI_CreateButtonPlateText(&gui->setperm, RESET_X, y,
RESET_WIDTH, LINE_HEIGHT,&DEFAULT_FONT, show_timerperm_cb, 0x0000, reset_timerperm_cb,(void *)(long)(absrow | 0x80));
#endif
update_countdown(absrow);
int selectable = (Model.timer[absrow].type < TIMER_COUNTDOWN) ? 2 : 3;
if (Model.mixer_mode == MIXER_ADVANCED)
selectable++;
#if HAS_PERMANENT_TIMER
if (Model.timer[absrow].type == TIMER_PERMANENT)
selectable = 4;
#endif
return selectable;
}
示例7: row_cb
static int row_cb(int absrow, int relrow, int y, void *data)
{
int num_elems = (long)data;
int y_ts = y;
//show elements in order
int row = -1;
#if HAS_LAYOUT_EDITOR
if (absrow == num_elems + NUM_QUICKPAGES) {
GUI_CreateTextSelectPlate(&gui->value[relrow], NEWTEXTSEL_X, y_ts,
NEWTEXTSEL_W, LINE_HEIGHT, &TEXTSEL_FONT, NULL, newelem_cb, NULL);
GUI_CreateButtonPlateText(&gui->col1[relrow].button, NEWBUTTON_X, y, NEWBUTTON_W,
LINE_HEIGHT, &BUTTON_FONT, add_dlgbut_str_cb, newelem_press_cb, (void *)1);
return 2;
}
#endif
if (absrow >= num_elems + NUM_QUICKPAGES) {
GUI_CreateButtonPlateText(&gui->col1[relrow].button, QPBUTTON_X, y, QPBUTTON_W, LINE_HEIGHT,
&BUTTON_FONT, add_dlgbut_str_cb, add_dlgbut_cb, (void *)0);
return 1;
}
if (absrow >= num_elems && absrow < num_elems + NUM_QUICKPAGES) {
GUI_CreateLabelBox(&gui->col1[relrow].label, MENULABEL_X, y, MENULABEL_W, LINE_HEIGHT, &LABEL_FONT, menulabel_cb, NULL, (void *)(long)(absrow - num_elems));
GUI_CreateTextSelectPlate(&gui->value[relrow], MENUTEXT_X, y + LINE_HEIGHT * LINE_OFFSET,
MENUTEXT_W, LINE_HEIGHT, &TEXTSEL_FONT, NULL, menusel_cb, (void *)(long)(absrow - num_elems));
return 1;
}
for(int type = 0; type < ELEM_LAST; type++) {
if (type == ELEM_BIGBOX || type == ELEM_HTRIM)
continue;
long nxt = -1;
long item = -1;
while((nxt = MAINPAGE_FindNextElem(type, nxt+1)) >= 0) {
item = nxt;
row++;
if(row == absrow)
break;
}
if (nxt == -1)
continue;
int selectable = 1;
if (type == ELEM_TOGGLE) {
GUI_CreateButtonPlateText(&gui->col1[relrow].button, ELEMBUT_X, y, ELEMBUT_W,
LINE_HEIGHT, &BUTTON_FONT, cfglabel_cb, switchicon_press_cb, (void *)item);
selectable = 2;
}
else
GUI_CreateLabelBox(&gui->col1[relrow].label, ELEMLBL_X, y, ELEMLBL_W, LINE_HEIGHT, &LABEL_FONT, cfglabel_cb, NULL, (void *)item);
GUI_CreateTextSelectPlate(&gui->value[relrow], ELEMTXT_X, y_ts,
ELEMTXT_W, LINE_HEIGHT, &TEXTSEL_FONT, (void(*)(guiObject_t *, void *))dlgbut_cb, dlgts1_cb, (void *)item);
return selectable;
}
return 0;
}
示例8: show_iconsel_page
static void show_iconsel_page(int SelectedIcon)
{
struct ImageMap img;
int toggleinput = MIXER_SRC(Model.pagecfg2.elem[tp->tglidx].src);
PAGE_RemoveAllObjects();
PAGE_ShowHeader(INPUT_SourceNameAbbrevSwitch(tempstring, toggleinput));
GUI_CreateButton(&gui->revert, LCD_WIDTH-96-8, 4, BUTTON_96, revert_str_cb, revert_cb, NULL);
// Show name of source for toggle icon
// style the switch textbox
struct LabelDesc outline = {
.font = DEFAULT_FONT.font,
.style = LABEL_TRANSPARENT,
.font_color = DEFAULT_FONT.font_color,
.fill_color = DEFAULT_FONT.fill_color,
.outline_color = DEFAULT_FONT.outline_color
};
GUI_CreateRect(&gui->toggleframe, 80+80*SelectedIcon, 39, 77, 33, &outline);
GUI_CreateLabelBox(&gui->switchbox, 4, 47, 70, 22, &NORMALBOX_FONT, NULL, NULL,
INPUT_SourceNameAbbrevSwitch(tempstring, Model.pagecfg2.elem[tp->tglidx].src));
int num_positions = INPUT_NumSwitchPos(toggleinput);
if(num_positions < 2)
num_positions = 2;
GUI_CreateLabelBox(&gui->togglelabel[0], 94, 50, 30, 14, &LABEL_FONT, NULL, NULL, _tr("Pos 0"));
img = TGLICO_GetImage(Model.pagecfg2.elem[tp->tglidx].extra[0]);
GUI_CreateImageOffset(&gui->toggleicon[0], 124, 40, TOGGLEICON_WIDTH, TOGGLEICON_HEIGHT, img.x_off, img.y_off, img.file,
SelectedIcon == 0 ? tglico_reset_cb : tglico_setpos_cb, (void *)0L);
GUI_CreateLabelBox(&gui->togglelabel[1], 174, 50, 30, 14, &LABEL_FONT, NULL, NULL, _tr("Pos 1"));
img = TGLICO_GetImage(Model.pagecfg2.elem[tp->tglidx].extra[1]);
GUI_CreateImageOffset(&gui->toggleicon[1], 204, 40, TOGGLEICON_WIDTH, TOGGLEICON_HEIGHT, img.x_off, img.y_off, img.file,
SelectedIcon == 1 ? tglico_reset_cb : tglico_setpos_cb, (void *)1L);
if (num_positions == 3) {
GUI_CreateLabelBox(&gui->togglelabel[2], 254, 50, 30, 14, &LABEL_FONT, NULL, NULL, _tr("Pos 2"));
img = TGLICO_GetImage(Model.pagecfg2.elem[tp->tglidx].extra[2]);
GUI_CreateImageOffset(&gui->toggleicon[2], 284, 40, TOGGLEICON_WIDTH, TOGGLEICON_HEIGHT, img.x_off, img.y_off, img.file,
SelectedIcon == 2 ? tglico_reset_cb : tglico_setpos_cb, (void *)2L);
}
int count = get_toggle_icon_count();
int max_scroll = (count + NUM_SYMBOL_COLS - 1) / NUM_SYMBOL_COLS - (NUM_SYMBOL_ROWS - 1);
if (max_scroll > 1) GUI_CreateScrollbar(&gui->scrollbar, LCD_WIDTH-16, 80, LCD_HEIGHT-80, max_scroll, NULL, scroll_cb, (void *)(long)SelectedIcon);
show_icons(SelectedIcon, 0);
}
void PAGE_ToggleEditInit(int page) {
tp->tglidx = page;
memcpy(tp->tglicons, Model.pagecfg2.elem[tp->tglidx].extra, sizeof(tp->tglicons));
show_iconsel_page(0);
}
示例9: PAGE_TouchInit
void PAGE_TouchInit(int page)
{
(void)page;
//PAGE_ShowHeader_ExitOnly("Touch Calibrate", okcancel_cb); //Can't do this while calibrating
GUI_CreateLabelBox(&guic->title, 40, 10, LCD_WIDTH - 40, 14, &TITLE_FONT, GUI_Localize, NULL, _tr_noop("Touch Calibrate"));
GUI_CreateLabelBox(&guic->msg, XCOORD - 5, YCOORD + 32 - 5, 11, 11, &SMALLBOX_FONT, NULL, NULL, "");
GUI_CreateLabelBox(&guic->msg1, (LCD_WIDTH - 100) /2, (LCD_HEIGHT - 20)/2, 100, 20, &NARROW_FONT, show_msg_cb, NULL, NULL);
memset(&cp->coords, 0, sizeof(cp->coords));
SPITouch_Calibrate(0x10000, 0x10000, 0, 0);
cp->state = 0;
}
示例10: row_cb
static int row_cb(int absrow, int relrow, int y, void *data)
{
(void)relrow;
(void)y;
(void)data;
cur_row = absrow;
int i;
u8 height;
u8 count;
int num_bars = cp->num_bars;
int num_rows = 1;
int row_len;
if (num_bars > 2 * (NUM_BARS_PER_ROW + 1)) {
num_rows = num_bars / NUM_BARS_PER_ROW + 1;
num_bars -= cur_row * NUM_BARS_PER_ROW;
if (num_bars > 2 * NUM_BARS_PER_ROW)
num_bars = 2 * NUM_BARS_PER_ROW;
row_len = NUM_BARS_PER_ROW;
} else {
row_len = NUM_BARS_PER_ROW + 1;
}
if (num_bars > row_len) {
height = 70 + (LCD_HEIGHT - 240) / 2;
count = (num_bars + 1) / 2;
} else {
height = 155 + (LCD_HEIGHT - 240);
count = num_bars;
}
u16 offset = (LCD_WIDTH + (SEPARATION - 10) - SEPARATION * ((num_rows > 2 ? 1 : 0) + count)) / 2;
memset(cp->pctvalue, 0, sizeof(cp->pctvalue));
for(i = 0; i < count; i++) {
GUI_CreateLabelBox(&gui->chan[i], offset + SEPARATION * i - (SEPARATION - 10)/2, 32,
SEPARATION, 19, &TINY_FONT, channum_cb, NULL, (void *)(long)i);
GUI_CreateBarGraph(&gui->bar[i], offset + SEPARATION * i, 52, 10, height,
-100, 100, BAR_VERTICAL,
showchan_cb, (void *)(long)i);
GUI_CreateLabelBox(&gui->value[i], offset + SEPARATION * i - (SEPARATION - 10)/2, 53 + height,
SEPARATION, 10, &TINY_FONT, value_cb, NULL, (void *)(long)i);
}
offset = (LCD_WIDTH + (SEPARATION - 10) - SEPARATION * ((num_rows > 2 ? 1 : 0) + (num_bars - count))) / 2;
for(i = count; i < num_bars; i++) {
GUI_CreateLabelBox(&gui->chan[i], offset + SEPARATION * (i - count) - (SEPARATION - 10)/2, 210 + (LCD_HEIGHT - 240) - height,
SEPARATION, 19, &TINY_FONT, channum_cb, NULL, (void *)(long)i);
GUI_CreateBarGraph(&gui->bar[i], offset + SEPARATION * (i - count), 230 + (LCD_HEIGHT - 240) - height, 10, height,
-100, 100, BAR_VERTICAL,
showchan_cb, (void *)(long)i);
GUI_CreateLabelBox(&gui->value[i], offset + SEPARATION * (i - count) - (SEPARATION - 10)/2, 230 + (LCD_HEIGHT - 240),
SEPARATION, 10, &TINY_FONT, value_cb, NULL, (void *)(long)i);
}
return 0;
}
示例11: _show_page
static void _show_page()
{
// PAGE_ShowHeader(_tr_noop("Trim")); // no title for devo10
GUI_CreateLabelBox(&gui->inputlbl, 0, 0, TEXTSEL_X, HEADER_HEIGHT, &TITLE_FONT, GUI_Localize, NULL, _tr_noop("Input"));
GUI_CreateLabelBox(&gui->steplbl, TEXTSEL_X, STEP_Y, TRIMPOS_X - TEXTSEL_X, LINE_HEIGHT, &TITLE_FONT, GUI_Localize, NULL, _tr_noop("Step"));
// no enought space in Devo10, so just display trim + in the 1st page
GUI_CreateLabelBox(&gui->trimposlbl, TRIMPOS_X, STEP_Y, LCD_WIDTH - TRIMPOS_X, LINE_HEIGHT, &TITLE_FONT, GUI_Localize, NULL, _tr_noop("Trim +"));
GUI_CreateScrollable(&gui->scrollable, 0, HEADER_HEIGHT, LCD_WIDTH, LCD_HEIGHT - HEADER_HEIGHT,
LINE_SPACE, NUM_TRIMS, row_cb, getobj_cb, NULL, NULL);
PAGE_SetScrollable(&gui->scrollable, ¤t_selected);
}
示例12: draw_chan
static void draw_chan(long ch, int row, int y)
{
int x = ch%2 ? 13 : 0;
int idx = ch%2 ? 2*row + 1 : 2*row;
int x_tra = cp->type == MONITOR_RAWINPUT ? 7 : 2;
GUI_CreateLabelBox(&gui->chan[idx], x, y,
0, 0, &labelDesc, _channum_cb, NULL, (void *)ch);
GUI_CreateLabelBox(&gui->value[idx], x+x_tra, y,
0, 0, &MICRO_FONT, value_cb, NULL, (void *)ch);
}
示例13: PAGE_AboutInit
void PAGE_AboutInit(int page)
{
(void)page;
PAGE_RemoveAllObjects();
PAGE_ShowHeader(PAGE_GetName(PAGEID_ABOUT));
PAGE_SetActionCB(_action_cb);
strcpy(up->tmpstr, (const char *) _tr("Deviation FW version:"));
GUI_CreateLabelBox(&gui->label[0], 0, 15, LCD_WIDTH, ITEM_HEIGHT, &DEFAULT_FONT, NULL, NULL, "www.deviationtx.com");
GUI_CreateLabelBox(&gui->label[1], 0, 30, LCD_WIDTH, ITEM_HEIGHT, &DEFAULT_FONT, NULL, NULL, up->tmpstr);
GUI_CreateLabelBox(&gui->label[2], 0, 45, LCD_WIDTH, ITEM_HEIGHT, &MICRO_FONT, NULL, NULL, _tr_noop(DeviationVersion));
}
示例14: row_cb
static int row_cb(int absrow, int relrow, int y, void *data)
{
int row_count = (long)data;
if (absrow >= row_count) {
GUI_CreateLabelBox(&gui->label[relrow], LCD_WIDTH/2-100, y,
200 - ARROW_WIDTH, LINE_HEIGHT, &LISTBOX_FONT, NULL, NULL, "");
} else {
GUI_CreateLabelBox(&gui->label[relrow], LCD_WIDTH/2-100, y,
200 - ARROW_WIDTH, LINE_HEIGHT, &LISTBOX_FONT, string_cb, press_cb, (void *)(long)absrow);
}
return 1;
}
示例15: init_touch_calib
static void init_touch_calib()
{
PAGE_RemoveAllObjects();
PAGE_SetModal(1);
//PAGE_ShowHeader_ExitOnly("Touch Calibrate", okcancel_cb); //Can't do this while calibrating
GUI_CreateLabel(&guic->title, 40, 10, NULL, TITLE_FONT, _tr("Touch Calibrate"));
GUI_CreateLabelBox(&guic->msg, XCOORD - 5, YCOORD + 32 - 5, 11, 11, &SMALLBOX_FONT, NULL, NULL, "");
GUI_CreateLabelBox(&guic->msg1, (LCD_WIDTH - 100) /2, (LCD_HEIGHT - 20)/2, 100, 20, &NARROW_FONT, show_msg_cb, NULL, NULL);
memset(&cp->coords, 0, sizeof(cp->coords));
SPITouch_Calibrate(0x10000, 0x10000, 0, 0);
cp->state = 0;
}