本文整理汇总了C++中Fl_Menu_Button::textsize方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Menu_Button::textsize方法的具体用法?C++ Fl_Menu_Button::textsize怎么用?C++ Fl_Menu_Button::textsize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Menu_Button
的用法示例。
在下文中一共展示了Fl_Menu_Button::textsize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __cb_openMenu
void gMidiChannel::__cb_openMenu() {
Fl_Menu_Item rclick_menu[] = {
{"Edit actions..."}, // 0
{"Clear actions", 0, 0, 0, FL_SUBMENU}, // 1
{"All"}, // 2
{0}, // 3
{"Setup MIDI output..."}, // 4
{"Setup MIDI input..."}, // 5
{"Delete channel"}, // 6
{0}
};
/* no 'clear actions' if there are no actions */
if (!ch->hasActions)
rclick_menu[1].deactivate();
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = rclick_menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Delete channel") == 0) {
if (!gdConfirmWin("Warning", "Delete channel: are you sure?"))
return;
glue_deleteChannel(ch);
return;
}
if (strcmp(m->label(), "All") == 0) {
if (!gdConfirmWin("Warning", "Clear all actions: are you sure?"))
return;
recorder::clearChan(ch->index);
gu_refreshActionEditor(); // refresh a.editor window, it could be open
return;
}
if (strcmp(m->label(), "Edit actions...") == 0) {
gu_openSubWindow(mainWin, new gdActionEditor(ch), WID_ACTION_EDITOR);
return;
}
if (strcmp(m->label(), "Setup MIDI output...") == 0) {
gu_openSubWindow(mainWin, new gdMidiInputSetup(ch), 0);
return;
}
if (strcmp(m->label(), "Setup MIDI input...") == 0) {
gu_openSubWindow(mainWin, new gdMidiGrabberChannel(ch), 0);
return;
}
}
示例2: __cb_open_edit_menu
void gdMainWindow::__cb_open_edit_menu() {
Fl_Menu_Item menu[] = {
{"Clear all samples"},
{"Clear all actions"},
{"Reset to init state"},
{0}
};
/* clear all actions disabled if no recs, clear all samples disabled
* if no samples. */
menu[1].deactivate();
for (unsigned i=0; i<MAX_NUM_CHAN; i++)
if (recorder::chanEvents[i]) {
menu[1].activate();
break;
}
for (unsigned i=0; i<MAX_NUM_CHAN; i++)
if (G_Mixer.chan[i] != NULL) {
menu[0].activate();
break;
}
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Clear all samples") == 0) {
if (!gdConfirmWin("Warning", "Clear all samples: are you sure?"))
return;
delSubWindow(WID_SAMPLE_EDITOR);
glue_clearAllSamples();
return;
}
if (strcmp(m->label(), "Clear all actions") == 0) {
if (!gdConfirmWin("Warning", "Clear all actions: are you sure?"))
return;
delSubWindow(WID_ACTION_EDITOR);
glue_clearAllRecs();
return;
}
if (strcmp(m->label(), "Reset to init state") == 0) {
if (!gdConfirmWin("Warning", "Reset to init state: are you sure?"))
return;
gu_closeAllSubwindows();
glue_resetToInitState();
return;
}
}
示例3: __cb_file
void gMenu::__cb_file()
{
/* An Fl_Menu_Button is made of many Fl_Menu_Item */
Fl_Menu_Item menu[] = {
{"Open patch or project..."},
{"Save patch..."},
{"Save project..."},
{"Quit Giada"},
{0}
};
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Open patch or project...") == 0) {
gWindow *childWin = new gdBrowser("Load Patch", G_Conf.patchPath.c_str(), 0, BROWSER_LOAD_PATCH);
gu_openSubWindow(mainWin, childWin, WID_FILE_BROWSER);
return;
}
if (strcmp(m->label(), "Save patch...") == 0) {
if (G_Mixer.hasLogicalSamples() || G_Mixer.hasEditedSamples())
if (!gdConfirmWin("Warning", "You should save a project in order to store\nyour takes and/or processed samples."))
return;
gWindow *childWin = new gdBrowser("Save Patch", G_Conf.patchPath.c_str(), 0, BROWSER_SAVE_PATCH);
gu_openSubWindow(mainWin, childWin, WID_FILE_BROWSER);
return;
}
if (strcmp(m->label(), "Save project...") == 0) {
gWindow *childWin = new gdBrowser("Save Project", G_Conf.patchPath.c_str(), 0, BROWSER_SAVE_PROJECT);
gu_openSubWindow(mainWin, childWin, WID_FILE_BROWSER);
return;
}
if (strcmp(m->label(), "Quit Giada") == 0) {
mainWin->do_callback();
return;
}
}
示例4: __cb_open_file_menu
void gdMainWindow::__cb_open_file_menu() {
/* An Fl_Menu_Button is made of many Fl_Menu_Item */
Fl_Menu_Item menu[] = {
{"Open patch or project..."},
{"Save patch..."},
{"Save project..."},
{"Quit Giada"},
{0}
};
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Open patch or project...") == 0) {
__cb_open_loadpatch_win();
return;
}
if (strcmp(m->label(), "Save patch...") == 0) {
if (G_Mixer.hasLogicalSamples() || G_Mixer.hasEditedSamples())
if (!gdConfirmWin("Warning", "You should save a project in order to store\nyour takes and/or processed samples."))
return;
__cb_open_savepatch_win();
return;
}
if (strcmp(m->label(), "Save project...") == 0) {
__cb_open_saveproject_win();
return;
}
if (strcmp(m->label(), "Quit Giada") == 0) {
__cb_endprogram();
return;
}
}
示例5: openChanTypeMenu
int Keyboard::openChanTypeMenu() {
Fl_Menu_Item rclick_menu[] = {
{"Sample channel"},
{"MIDI channel"},
{0}
};
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = rclick_menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return 0;
if (strcmp(m->label(), "Sample channel") == 0)
return CHANNEL_SAMPLE;
if (strcmp(m->label(), "MIDI channel") == 0)
return CHANNEL_MIDI;
return 0;
}
示例6: __cb_edit
void gMenu::__cb_edit()
{
Fl_Menu_Item menu[] = {
{"Clear all samples"},
{"Clear all actions"},
{"Remove empty columns"},
{"Reset to init state"},
{"Setup global MIDI input..."},
{0}
};
/* clear all actions disabled if no recs, clear all samples disabled
* if no samples. */
menu[1].deactivate();
for (unsigned i=0; i<G_Mixer.channels.size(); i++)
if (G_Mixer.channels.at(i)->hasActions) {
menu[1].activate();
break;
}
for (unsigned i=0; i<G_Mixer.channels.size(); i++)
if (G_Mixer.channels.at(i)->type == CHANNEL_SAMPLE)
if (((SampleChannel*)G_Mixer.channels.at(i))->wave != NULL) {
menu[0].activate();
break;
}
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Clear all samples") == 0) {
if (!gdConfirmWin("Warning", "Clear all samples: are you sure?"))
return;
mainWin->delSubWindow(WID_SAMPLE_EDITOR);
glue_clearAllSamples();
return;
}
if (strcmp(m->label(), "Clear all actions") == 0) {
if (!gdConfirmWin("Warning", "Clear all actions: are you sure?"))
return;
mainWin->delSubWindow(WID_ACTION_EDITOR);
glue_clearAllRecs();
return;
}
if (strcmp(m->label(), "Reset to init state") == 0) {
if (!gdConfirmWin("Warning", "Reset to init state: are you sure?"))
return;
gu_closeAllSubwindows();
glue_resetToInitState();
return;
}
if (strcmp(m->label(), "Remove empty columns") == 0) {
mainWin->keyboard->organizeColumns();
return;
}
if (strcmp(m->label(), "Setup global MIDI input...") == 0) {
gu_openSubWindow(mainWin, new gdMidiInputMaster(), 0);
return;
}
}
示例7: openEditMenu
void gWaveform::openEditMenu() {
if (selectionA == selectionB)
return;
menuOpen = true;
Fl_Menu_Item menu[] = {
{"Cut"},
{"Trim"},
{"Silence"},
{"Fade in"},
{"Fade out"},
{"Smooth edges"},
{"Set start/end here"},
{0}
};
if (chan->status == STATUS_PLAY) {
menu[0].deactivate();
menu[1].deactivate();
}
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(11);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) {
menuOpen = false;
return;
}
/* straightSel() to ensure that point A is always lower than B */
straightSel();
if (strcmp(m->label(), "Silence") == 0) {
wfx_silence(chan->wave, absolutePoint(selectionA), absolutePoint(selectionB));
selectionA = 0;
selectionB = 0;
stretchToWindow();
redraw();
menuOpen = false;
return;
}
if (strcmp(m->label(), "Set start/end here") == 0) {
glue_setBeginEndChannel(
(gdEditor *) window(), // parent
chan,
absolutePoint(selectionA) * 2, // stereo!
absolutePoint(selectionB) * 2, // stereo!
false, // no recalc (we do it here)
false // don't check
);
selectionA = 0;
selectionB = 0;
selectionA_abs = 0;
selectionB_abs = 0;
recalcPoints();
redraw();
menuOpen = false;
return;
}
if (strcmp(m->label(), "Cut") == 0) {
wfx_cut(chan->wave, absolutePoint(selectionA), absolutePoint(selectionB));
/* for convenience reset start/end points */
glue_setBeginEndChannel(
(gdEditor *) window(),
chan,
0,
chan->wave->size,
false);
selectionA = 0;
selectionB = 0;
selectionA_abs = 0;
selectionB_abs = 0;
setZoom(0);
menuOpen = false;
return;
}
if (strcmp(m->label(), "Trim") == 0) {
wfx_trim(chan->wave, absolutePoint(selectionA), absolutePoint(selectionB));
glue_setBeginEndChannel(
//.........这里部分代码省略.........
示例8: __cb_openMenu
void gSampleChannel::__cb_openMenu()
{
if (G_Mixer.chanInput == ch || recorder::active)
return;
Fl_Menu_Item rclick_menu[] = {
{"Load new sample..."},
{"Export sample to file..."},
{"Setup keyboard input..."},
{"Setup MIDI input..."},
{"Setup MIDI output..."},
{"Edit sample..."},
{"Edit actions..."},
{"Clear actions", 0, 0, 0, FL_SUBMENU},
{"All"},
{"Mute"},
{"Volume"},
{"Start/Stop"},
{0},
{"Clone channel"},
{"Free channel"},
{"Delete channel"},
{0}
};
if (ch->status & (STATUS_EMPTY | STATUS_MISSING)) {
rclick_menu[1].deactivate();
rclick_menu[5].deactivate();
rclick_menu[14].deactivate();
}
if (!ch->hasActions)
rclick_menu[7].deactivate();
if (ch->mode & LOOP_ANY)
rclick_menu[11].deactivate();
Fl_Menu_Button *b = new Fl_Menu_Button(0, 0, 100, 50);
b->box(G_BOX);
b->textsize(GUI_FONT_SIZE_BASE);
b->textcolor(COLOR_TEXT_0);
b->color(COLOR_BG_0);
const Fl_Menu_Item *m = rclick_menu->popup(Fl::event_x(), Fl::event_y(), 0, 0, b);
if (!m) return;
if (strcmp(m->label(), "Load new sample...") == 0) {
openBrowser(BROWSER_LOAD_SAMPLE);
return;
}
if (strcmp(m->label(), "Setup keyboard input...") == 0) {
new gdKeyGrabber(ch);
return;
}
if (strcmp(m->label(), "Setup MIDI input...") == 0) {
gu_openSubWindow(mainWin, new gdMidiInputChannel(ch), 0);
return;
}
if (strcmp(m->label(), "Setup MIDI output...") == 0) {
gu_openSubWindow(mainWin, new gdMidiOutputSampleCh(ch), 0);
return;
}
if (strcmp(m->label(), "Edit sample...") == 0) {
gu_openSubWindow(mainWin, new gdEditor(ch), WID_SAMPLE_EDITOR);
return;
}
if (strcmp(m->label(), "Export sample to file...") == 0) {
openBrowser(BROWSER_SAVE_SAMPLE);
return;
}
if (strcmp(m->label(), "Delete channel") == 0) {
if (!gdConfirmWin("Warning", "Delete channel: are you sure?"))
return;
glue_deleteChannel(ch);
return;
}
if (strcmp(m->label(), "Free channel") == 0) {
if (ch->status == STATUS_PLAY) {
if (!gdConfirmWin("Warning", "This action will stop the channel: are you sure?"))
return;
}
else if (!gdConfirmWin("Warning", "Free channel: are you sure?"))
return;
glue_freeChannel(ch);
//.........这里部分代码省略.........