Exemple #1
0
void ZCGtkTabPanel::addTab(const std::string& name, Widget* w)
{
    std::string mod=convertMnemonic(name);
    GtkWidget* label=gtk_label_new_with_mnemonic(mod.c_str());
    
    // Put the content in a scrolling pane, in case it's really big
    // TODO: Maybe do something better about the size
    GtkWidget* scrollPane=gtk_scrolled_window_new(0, 0);
    gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrollPane), 480);
    g_signal_connect(scrollPane, "destroy", G_CALLBACK(gtk_widget_destroyed), &scrollPane);
    
    ZCGtkWidget* zw=dynamic_cast<ZCGtkWidget*>(w);
    contents.push_back(zw);
    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrollPane), zw->get());
    gtk_notebook_append_page(GTK_NOTEBOOK(tabPanel), scrollPane, label);
}
Exemple #2
0
Row::Row(QString line, int number, const FORMAT &format, const TYPE &type) : type(type)
{
    this->number = number;
    bool ok = false;
    switch (format)
    {
    case Row::binary :
        this->opcode = line.toUShort(&ok, 2);
        break;
    case Row::hexa :
        this->opcode = line.toUShort(&ok, 16);
        break;
    case Row::mnemonic :
        this->opcode = convertMnemonic(line);
        break;
    }
}