本文整理汇总了C++中VerticalLayout::append方法的典型用法代码示例。如果您正苦于以下问题:C++ VerticalLayout::append方法的具体用法?C++ VerticalLayout::append怎么用?C++ VerticalLayout::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VerticalLayout
的用法示例。
在下文中一共展示了VerticalLayout::append方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reflow
void reflow() {
unsigned i;
for (i=0; i<N::OPN::Types::Total; ++i) lTogglesOPN.append(opnToggles[i], {~0,0}, 2);
for (i=0; i<N::OPM::Types::Total; ++i) lTogglesOPM.append(opmToggles[i], {~0,0}, 2);
append(lMain);
lMain.append(tabMain, {~0,~0});
}
示例2: Application
Application() {
setGeometry({256, 256, 640, 400});
layout.setMargin(5);
button.setText("Toggle");
itemA[0].setText("Item A0");
itemA[1].setText("Item A1");
itemA[2].setText("Item A2");
RadioBox::group(itemA[0], itemA[1], itemA[2]);
itemB[0].setText("Item B0");
itemB[1].setText("Item B1");
itemB[2].setText("Item B2");
RadioBox::group(itemB[0], itemB[1], itemB[2]);
itemC[0].setText("Item C0");
itemC[1].setText("Item C1");
itemC[2].setText("Item C2");
RadioBox::group(itemC[0], itemC[1], itemC[2]);
append(layout);
layout.append(button, {~0, 0}, 5);
layout.append(groupA, {~0, 0}, 5);
groupA.append(itemA[0], {~0, 0}, 5);
groupA.append(itemA[1], {~0, 0}, 5);
groupA.append(itemA[2], {~0, 0});
layout.append(groupB, {~0, 0}, 5);
groupB.append(itemB[0], {~0, 0}, 5);
groupB.append(itemB[1], {~0, 0}, 5);
groupB.append(itemB[2], {~0, 0});
layout.append(groupC, {~0, 0}, 5);
groupC.append(itemC[0], {~0, 0}, 5);
groupC.append(itemC[1], {~0, 0}, 5);
groupC.append(itemC[2], {~0, 0});
onClose = &OS::quit;
itemC[0].onActivate = [] { print("C0\n"); };
itemC[1].onActivate = [] { print("C1\n"); };
itemC[2].onActivate = [] { print("C2\n"); };
button.onActivate = [&] {
//print("Before: ", itemC[0].checked(), ",", itemC[1].checked(), ",", itemC[2].checked(), "\n");
static bool visible = true;
if(visible) {
layout.remove(groupC);
} else {
layout.append(groupC, {~0, 0}, 5);
}
visible = !visible;
//print("After!: ", itemC[0].checked(), ",", itemC[1].checked(), ",", itemC[2].checked(), "\n");
};
setVisible();
}
示例3: create
void create() {
for(unsigned n = 0; n < 544; n++) buffer[n] = n;
hexEditFont.setFamily("Liberation Mono");
hexEditFont.setSize(8);
hexEdit.setFont(hexEditFont);
hexEdit.onRead = [this](unsigned addr) { return this->buffer[addr]; };
hexEdit.onWrite = [this](unsigned addr, uint8_t data) { this->buffer[addr] = data; };
hexEdit.setColumns(16);
hexEdit.setRows(16);
hexEdit.setOffset(0);
hexEdit.setLength(544);
layout.setMargin(5);
layout.append(hexEdit, ~0, ~0);
append(layout);
onClose = []() { OS::quit(); };
setStatusText("Ready");
setStatusVisible();
setTitle("Hex Edit");
setGeometry({ 64, 64, 485, 220 });
setVisible();
}
示例4: MainWindow
MainWindow() {
setFrameGeometry({64, 64, 640, 480});
layout.setMargin(5);
listView.append("Item 1");
listView.append("Item 2");
listView.append("Item 3");
listView.setSelection(1);
layout.append(listView, {~0, ~0});
append(layout);
onClose = &Application::quit;
listView.onActivate = [&] {
if(modal() == false) {
print("Base = ", listView.selection(), "\n");
setModal(true);
} else {
print("Slot = ", listView.selection(), "\n");
setModal(false);
setVisible(false);
}
};
setVisible();
listView.setFocused();
}
示例5: VideoPanel
VideoPanel() {
setMargin(5);
append(spacer, 120, ~0, 5);
append(layout, ~0, ~0);
label.setFont("Sans, 16, Bold");
label.setText("Video");
layout.append(label, ~0, 0, 5);
}
示例6: AudioPanel
AudioPanel() {
setMargin(5);
append(spacer, 120, ~0, 5);
append(layout, ~0, ~0);
label.setFont("Sans, 16, Bold");
label.setText("Audio");
list.setCheckable();
list.append("Item");
list.append("Item");
list.append("Item");
list.append("Item");
list.append("Item");
layout.append(label, ~0, 0, 5);
layout.append(list, ~0, ~0);
list.onTick = [&](unsigned n) { print("Row ", n, "\n"); };
}
示例7: MainWindow
MainWindow() : audio_window(settings, mute_item), video_window(settings, *this), input_window(settings, input, [&]{ run(); }),
circuit(nullptr), prev_ui_state{false, false, false, false}
{
// Load config file
nall::string config_path = configpath();
config_path.append("dice/");
directory::create(config_path);
settings.filename = {config_path, "settings.cfg"};
settings.load();
onClose = &Application::quit;
// Game menu
game_menu.setText("Game");
new_game_item.setText("New Game...");
new_game_item.onActivate = [&] { game_window.create(geometry().position()); };
game_window.cancel_button.onActivate = [&] { game_window.setModal(false); game_window.setVisible(false); };
game_window.start_button.onActivate = [&]
{
GameDesc& g = game_list[game_window.game_view.selection()];
if(circuit) delete circuit;
circuit = new Circuit(settings, *input, *video, g.desc, g.command_line);
game_window.setModal(false);
game_window.setVisible(false);
onSize();
};
game_menu.append(new_game_item);
end_game_item.setText("End Game");
end_game_item.onActivate = [&]
{
if(circuit)
{
delete circuit;
circuit = nullptr;
}
onSize();
};
game_menu.append(end_game_item);
game_menu.append(game_sep[0]);
pause_item.setText("Pause");
pause_item.onToggle = [&] { settings.pause = pause_item.checked(); };
throttle_item.setText("Throttle");
throttle_item.setChecked(true);
throttle_item.onToggle = [&]
{
settings.throttle = throttle_item.checked();
if(settings.throttle && circuit) // Adjust rtc
{
uint64_t emu_time = circuit->global_time * 1000000.0 * Circuit::timescale;
circuit->rtc += int64_t(circuit->rtc.get_usecs()) - emu_time;
}
};
game_menu.append(pause_item, throttle_item);
game_menu.append(game_sep[1]);
exit_item.setText("Exit");
exit_item.onActivate = onClose;
game_menu.append(exit_item);
append(game_menu);
// Settings menu
settings_menu.setText("Settings");
audio_item.setText("Audio Settings...");
settings_menu.append(audio_item);
audio_item.onActivate = [&] { audio_window.create(geometry().position()); };
audio_window.onClose = audio_window.exit_button.onActivate = [&]
{
mute_item.setChecked(settings.audio.mute);
audio_window.setModal(false);
audio_window.setVisible(false);
if(circuit) circuit->audio.toggle_mute();
};
mute_item.setText("Mute Audio");
mute_item.setChecked(settings.audio.mute);
mute_item.onToggle = [&]
{
settings.audio.mute = mute_item.checked();
if(circuit) circuit->audio.toggle_mute();
};
settings_menu.append(mute_item);
settings_menu.append(settings_sep[0]);
video_item.setText("Video Settings...");
video_item.onActivate = [&] { video_window.create(geometry().position()); };
status_visible_item.setText("Status Bar Visible");
status_visible_item.setChecked(settings.video.status_visible);
status_visible_item.onToggle = [&]
{
settings.video.status_visible = status_visible_item.checked();
setStatusVisible(settings.video.status_visible);
};
//.........这里部分代码省略.........