WxSQLiteTest::WxSQLiteTest(const wxString& title):
    wxFrame(NULL, -1, title, wxPoint(-1, -1), wxSize(640, 480))
{
    // begin wxGlade: WxSQLiteTest::WxSQLiteTest
	// パネルの初期化とトップの設定
	// どうしてwxGladeは生成した逆順にオブジェクト宣言するんですかね・・・
    panel_12 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxFULL_REPAINT_ON_RESIZE);

    panel_sql = new wxPanel(this, wxID_ANY);

    panel_11 = new wxPanel(this, wxID_ANY);
    panel_10 = new wxPanel(this, wxID_ANY);
    panel_9 = new wxPanel(this, wxID_ANY);
    panel_8 = new wxPanel(this, wxID_ANY);
    panel_7 = new wxPanel(this, wxID_ANY);
    panel_6 = new wxPanel(this, wxID_ANY);
    panel_5 = new wxPanel(this, wxID_ANY);
    panel_4 = new wxPanel(this, wxID_ANY);
    panel_3 = new wxPanel(this, wxID_ANY);
    panel_2 = new wxPanel(this, wxID_ANY);

    // 一番上のパネル
    panel_topDataBaseForm = new wxPanel(this, wxID_ANY);
    label_topDataBaseForm = new wxStaticText(panel_topDataBaseForm, wxID_ANY, wxT("作成するデータベース名"));
    text_topDataBaseForm = new wxTextCtrl(panel_topDataBaseForm, wxID_ANY, wxT(""));
    button_topDataBaseForm = new wxButton(panel_topDataBaseForm, wxID_CREATEDB_BUTTON, wxT("作成"));

    // データ型選択プルダウンに用意するArrayString
	//    NULL       NULL値
	//    INTEGER    符号付整数。1, 2, 3, 4, 6, or 8 バイトで格納
	//    REAL       浮動小数点数。8バイトで格納
	//    TEXT       テキスト。UTF-8, UTF-16BE or UTF-16-LEのいずれかで格納
	//    BLOB       Binary Large OBject。入力データをそのまま格納

	wxArrayString dataType;
	dataType.Add(wxT("カラムを作らない"));
    dataType.Add(wxT("NULL"));
    dataType.Add(wxT("INTEGER"));
    dataType.Add(wxT("REAL"));
    dataType.Add(wxT("TEXT"));
    dataType.Add(wxT("BLOB"));

    // 各カラムのデータ
    // カラム1
    label_1 = new wxStaticText(panel_2, wxID_ANY, wxT("カラム1 "));
    label_2 = new wxStaticText(panel_2, wxID_ANY, wxT(" データ型"));
    // wxComboBoxの初期化 wxArrayStringを使った場合
    /** wxComboBox(wxWindow* parent,
    wxWindowID id,
    const wxString& value,
    const wxPoint& pos,
    const wxSize& size,
    const wxArrayString& choices,
    long style = 0,
    const wxValidator& validator = wxDefaultValidator,
    const wxString& name = "comboBox") */

    combo_box_1 = new wxComboBox(panel_2, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column1 = new wxTextCtrl(panel_2, wxID_ANY, wxT(""));

    // カラム2
    label_1_copy = new wxStaticText(panel_3, wxID_ANY, wxT("カラム2 "));
    label_2_copy = new wxStaticText(panel_3, wxID_ANY, wxT(" データ型"));
    combo_box_2 = new wxComboBox(panel_3, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column2 = new wxTextCtrl(panel_3, wxID_ANY, wxT(""));

    // カラム3
    label_1_copy_1 = new wxStaticText(panel_4, wxID_ANY, wxT("カラム3 "));
    label_2_copy_1 = new wxStaticText(panel_4, wxID_ANY, wxT(" データ型"));
    combo_box_3 = new wxComboBox(panel_4, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column3 = new wxTextCtrl(panel_4, wxID_ANY, wxT(""));

    // カラム4
    label_1_copy_2 = new wxStaticText(panel_5, wxID_ANY, wxT("カラム4 "));
    label_2_copy_2 = new wxStaticText(panel_5, wxID_ANY, wxT(" データ型"));
    combo_box_4 = new wxComboBox(panel_5, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column4 = new wxTextCtrl(panel_5, wxID_ANY, wxT(""));

    // カラム5
    label_1_copy_3 = new wxStaticText(panel_6, wxID_ANY, wxT("カラム5 "));
    label_2_copy_3 = new wxStaticText(panel_6, wxID_ANY, wxT(" データ型"));
    combo_box_5 = new wxComboBox(panel_6, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column5 = new wxTextCtrl(panel_6, wxID_ANY, wxT(""));

    // カラム6
    label_1_copy_3_copy = new wxStaticText(panel_7, wxID_ANY, wxT("カラム6 "));
    label_2_copy_3_copy = new wxStaticText(panel_7, wxID_ANY, wxT(" データ型"));
    combo_box_6 = new wxComboBox(panel_7, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column6 = new wxTextCtrl(panel_7, wxID_ANY, wxT(""));

    // カラム7
    label_1_copy_3_copy_copy = new wxStaticText(panel_8, wxID_ANY, wxT("カラム7 "));
    label_2_copy_3_copy_copy = new wxStaticText(panel_8, wxID_ANY, wxT(" データ型"));
    combo_box_7 = new wxComboBox(panel_8, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column7 = new wxTextCtrl(panel_8, wxID_ANY, wxT(""));

    // カラム8
    label_1_copy_3_copy_copy_1 = new wxStaticText(panel_9, wxID_ANY, wxT("カラム8 "));
    label_2_copy_3_copy_copy_1 = new wxStaticText(panel_9, wxID_ANY, wxT(" データ型"));
    combo_box_8 = new wxComboBox(panel_9, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column8 = new wxTextCtrl(panel_9, wxID_ANY, wxT(""));

    // カラム9
    label_1_copy_3_copy_copy_2 = new wxStaticText(panel_10, wxID_ANY, wxT("カラム9 "));
    label_2_copy_3_copy_copy_2 = new wxStaticText(panel_10, wxID_ANY, wxT(" データ型"));
    combo_box_9 = new wxComboBox(panel_10, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column9 = new wxTextCtrl(panel_10, wxID_ANY, wxT(""));

    // カラム10
    label_1_copy_3_copy_copy_3 = new wxStaticText(panel_11, wxID_ANY, wxT("カラム10"));
    label_2_copy_3_copy_copy_3 = new wxStaticText(panel_11, wxID_ANY, wxT(" データ型"));
    combo_box_10 = new wxComboBox(panel_11, wxID_ANY, dataType[0], wxPoint(-1, -1), wxDefaultSize, dataType, wxCB_DROPDOWN, wxDefaultValidator, wxT("comboBox"));
    column10 = new wxTextCtrl(panel_11, wxID_ANY, wxT(""));

    // SQL文実行部分
    label_sql = new wxStaticText(panel_sql, wxID_ANY, wxT("SQL文を下に入力してください"));
    btn_sql1 = new wxButton(panel_sql, wxID_ConnectDB, wxT("指定したDBに接続"));
    btn_sql2 = new wxButton(panel_sql, wxID_DisConnectDB, wxT("DBとの接続を切る"));

    // ログ出力用テキストコントロール
    text_ctrl_1 = new wxTextCtrl(panel_12, wxID_ANY, wxEmptyString);

    set_properties(title);
    do_layout();
    // end wxGlade

	this->CreateStatusBar();
	this->SetStatusText(wxT("準備完了"));
}
Exemple #2
0
V4StudioFrame::V4StudioFrame():
    wxFrame((wxFrame *) NULL, -1, "V4Studio", wxPoint(50, 50), wxSize(800, 700))
{

	m_pV4sm = NULL;

	m_selection = NULL;
	m_parentSelection = NULL;
	m_clipboardNode = NULL;

	m_frame = 0; // we start at frame=0
	editDict = false;

	// Creates components and places them on the form
	fieldView = new V4FieldList(this, wxSize(100,250));
	treeView = new V4StudioTree(this, wxSize(100,250), fieldView);
	timeLine = new V4TimeLine(this);
	timeLine->SetSize(500, 100);
	cmdPanel = new V4CommandPanel(this);
	cmdPanel->SetSize(100, 100);

	/*new m_pFileMenu bar*/
	wxMenuBar *b = new wxMenuBar();
	/*file*/
	m_pFileMenu = new wxMenu();
	m_pFileMenu->Append(MENU_FILE_NEW, "&New\tCtrl+N", "Create a new document");
	m_pFileMenu->Append(MENU_FILE_OPEN, "&Open...\tCtrl+O", "Open an existing document");
	m_pFileMenu->Append(MENU_FILE_SAVE, "&Save\tCtrl+S", "Save the active document");
	m_pFileMenu->Append(MENU_FILE_CLOSE, "&Close\tCtrl+X", "Close the active document");
	m_pFileMenu->AppendSeparator();
	m_pFileMenu->Append(CHANGE_SIZE_DIALOG, "&Size\tCtrl+Z", "Change scene size");
	m_pFileMenu->Append(CHANGE_FRAMERATE, "&FrameRate\tCtrl+F", "Change FrameRate");
	m_pFileMenu->Append(CHANGE_LENGTH, "&Length\tCtrl+L", "Change Length");
	m_pFileMenu->AppendSeparator();
	m_pFileMenu->Append(MENU_FILE_QUIT, "E&xit", "Quit the application; prompts to save documents");
	b->Append(m_pFileMenu, "&File");
	SetMenuBar(b);

	/*file*/
	m_pToolsMenu = new wxMenu();
	m_pToolsMenu->Append(MENU_TOOL_SHOW_LOWLEVEL, "&Low-Level\tCtrl+L", "Shows the low-level toolbar");
	m_pToolsMenu->Append(MENU_TOOL_SHOW_HIGHLEVEL, "&High-Level\tCtrl+H", "Shows the high-level toolbar");
	b->Append(m_pToolsMenu, "&Tools");
	SetMenuBar(b);

	m_pStatusbar = CreateStatusBar();

	// Main Toolbar
	m_pMainToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_FLAT);
	m_pMainToolbar->AddTool(TOOL_FILE_NEW, _("New"), wxBitmap (wxT("rc\\new.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open a new file"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_FILE_OPEN, _("Open"), wxBitmap (wxT("rc\\open.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open an existing file (BT/XMT/MP4)"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_FILE_SAVE, _("Save"), wxBitmap (wxT("rc\\save.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Save to a file"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_FILE_CLOSE, _("Close"), wxBitmap (wxT("rc\\close.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Close the file"), wxT(""));
	m_pMainToolbar->AddSeparator();
	m_pMainToolbar->AddTool(TOOL_FILE_PREVIEW, _("Preview"), wxBitmap (wxT("rc\\preview.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Preview in player"), wxT(""));
	m_pMainToolbar->AddSeparator();
	m_pMainToolbar->AddTool(TOOL_EDIT_CUT, _("Cut"), wxBitmap (wxT("rc\\cut.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Cut"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_EDIT_COPY, _("Copy"), wxBitmap (wxT("rc\\copy.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Copy"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_EDIT_PASTE, _("Paste"), wxBitmap (wxT("rc\\paste.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Paste"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_EDIT_PASTE_USE, _("PastePlus"), wxBitmap (wxT("rc\\paste_use.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Paste a USE"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_EDIT_DELETE, _("Delete"), wxBitmap (wxT("rc\\delete.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Delete"), wxT(""));
	m_pMainToolbar->AddSeparator();
	m_pMainToolbar->AddTool(TOOL_EDIT_UNDO, _("Undo"), wxBitmap (wxT("rc\\undo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Undo"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_EDIT_REDO, _("Redo"), wxBitmap (wxT("rc\\redo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Redo"), wxT(""));
	m_pMainToolbar->AddSeparator();

	m_pMainToolbar->AddSeparator();

	m_pMainToolbar->AddTool(TOOL_ADD_TO_TL, _("AddToTL"), wxBitmap( wxT("rc\\paste.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add to timeLine"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_NEXT_FRAME, _("NextFrame"), wxBitmap( wxT("rc\\redo.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Next frame"), wxT(""));
	m_pMainToolbar->AddTool(TOOL_VIEW_DICT, _("ViewDict"), wxBitmap( wxT("rc\\open.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("View Dictionnary"), wxT(""));

	/* Not Implemented yet */
	m_pMainToolbar->EnableTool(TOOL_FILE_PREVIEW, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_UNDO, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_REDO, false);
	m_pMainToolbar->EnableTool(TOOL_NEXT_FRAME, false);

	/* Not available when starting V4Studio */
	/* Nothing to save */
	m_pFileMenu->Enable(MENU_FILE_SAVE, false);
	m_pFileMenu->Enable(MENU_FILE_CLOSE, false);
	m_pFileMenu->Enable(CHANGE_SIZE_DIALOG, false);
	m_pFileMenu->Enable(CHANGE_LENGTH, false);
	m_pFileMenu->Enable(CHANGE_FRAMERATE, false);
	m_pMainToolbar->EnableTool(TOOL_FILE_SAVE, false);
	m_pMainToolbar->EnableTool(TOOL_FILE_CLOSE, false);

	/* Nothing to edit */
	m_pMainToolbar->EnableTool(TOOL_EDIT_CUT, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_COPY, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE_USE, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_DELETE, false);

	m_pMainToolbar->EnableTool(TOOL_ADD_TO_TL, false);
	m_pMainToolbar->EnableTool(TOOL_VIEW_DICT, false);
	m_pMainToolbar->Realize();
	SetToolBar(m_pMainToolbar);

	m_uSelectedNodeToolBar = 0;
	// Node Creation Toolbar
	m_pLowLevelNodeToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL|wxTB_FLAT);
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_ORDEREDGROUP, _("OrderedGroup"), wxBitmap (wxT("rc\\orderedgroup.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an OrderedGroup"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LAYER2D, _("Layer2D"), wxBitmap (wxT("rc\\layer2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Layer2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TRANSFORM2D, _("Transform2D"), wxBitmap (wxT("rc\\t2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Tranform2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TRANSFORMMATRIX2D, _("TransformMatrix2D"), wxBitmap (wxT("rc\\tm2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a TranformMatrix2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_COLOR_TRANSFORM, _("ColorTransform"), wxBitmap (wxT("rc\\colortransform.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a ColorTransform"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_SHAPE, _("Shape"), wxBitmap (wxT("rc\\shape.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Shape"), wxT(""));
	m_pLowLevelNodeToolbar->AddSeparator();
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_APPEARANCE, _("Appearance"), wxBitmap (wxT("rc\\appearance.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an Appearance"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_MATERIAL2D, _("Material2D"), wxBitmap (wxT("rc\\material2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Material2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LINEPROPS, _("LineProps"), wxBitmap (wxT("rc\\lineproperties.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a LineProperties"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_LINEAR_GRADIENT, _("LinearGradient"), wxBitmap (wxT("rc\\lg.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Linear Gradient"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_RADIAL_GRADIENT, _("RadialGradient"), wxBitmap (wxT("rc\\rg.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Radial Gradient"), wxT(""));
	m_pLowLevelNodeToolbar->AddSeparator();
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_RECT, _("Rectangle"), wxBitmap (wxT("rc\\rect.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Rectangle"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_CIRCLE, _("Circle"), wxBitmap (wxT("rc\\circle.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Rectangle"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_IFS2D, _("IndexedFaceSet2D"), wxBitmap (wxT("rc\\ifs2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an IndexedFaceSet2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_ILS2D, _("IndexedLineSet2D"), wxBitmap (wxT("rc\\ils2d.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an IndexedLineSet2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_XLINEPROPS, _("XLineProps"), wxBitmap (wxT("rc\\xlineproperties.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create an XLineProperties"), wxT(""));
	m_pLowLevelNodeToolbar->AddSeparator();
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_TEXT, _("Text"), wxBitmap (wxT("rc\\text.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a Text"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_FONTSTYLE, _("FontStyle"), wxBitmap (wxT("rc\\fs.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Create a FontStyle"), wxT(""));
	m_pLowLevelNodeToolbar->AddSeparator();
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_BACKGROUND2D, _("Background2D"), wxBitmap (wxT("rc\\image.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Background2D"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_MOVIE, _("Movie"), wxBitmap (wxT("rc\\movie.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Movie"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_IMAGE, _("Image"), wxBitmap (wxT("rc\\image.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add an Image"), wxT(""));
	m_pLowLevelNodeToolbar->AddTool(TOOL_NEW_SOUND, _("Sound"), wxBitmap (wxT("rc\\sound.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Add a Sound"), wxT(""));
	m_pLowLevelNodeToolbar->Realize();

/*
	m_pHighLevelNodeToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_VERTICAL|wxTB_FLAT);
	m_pHighLevelNodeToolbar->AddTool(TOOL_NEW_2DSCENE, _("OrderedGroup"), wxBitmap (wxT("rc\\orderedgroup.bmp"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Creates a 2D scene"), wxT(""));
	m_pHighLevelNodeToolbar->Realize();
*/
	set_properties();
	do_layout();
	UpdateToolBar();
}
int clobber_parse_optionst::doit()
{
  if(cmdline.isset("version"))
  {
    std::cout << CBMC_VERSION << std::endl;
    return 0;
  }

  register_language(new_ansi_c_language);
  register_language(new_cpp_language);

  //
  // command line options
  //

  optionst options;
  get_command_line_options(options);

  eval_verbosity();

  goto_functionst goto_functions;

  if(get_goto_program(options, goto_functions))
    return 6;
    
  label_properties(goto_functions);

  if(cmdline.isset("show-properties"))
  {
    const namespacet ns(symbol_table);
    show_properties(ns, get_ui(), goto_functions);
    return 0;
  }

  if(set_properties(goto_functions))
    return 7;
    
  // do instrumentation

  try
  {
    const namespacet ns(symbol_table);
    
    std::ofstream out("simulator.c");
    
    if(!out)
      throw std::string("failed to create file simulator.c");
    
    dump_c(goto_functions, true, ns, out);
    
    status() << "instrumentation complete; compile and execute simulator.c" << eom;
    
    return 0;
  }
  
  catch(const std::string error_msg)
  {
    error() << error_msg << messaget::eom;
    return 8;
  }

  catch(const char *error_msg)
  {
    error() << error_msg << messaget::eom;
    return 8;
  }

  #if 0                                         
  // let's log some more statistics
  debug() << "Memory consumption:" << messaget::endl;
  memory_info(debug());
  debug() << eom;
  #endif
}
int symex_parseoptionst::doit()
{
  if(cmdline.isset("version"))
  {
    std::cout << CBMC_VERSION << std::endl;
    return 0;
  }

  register_language(new_ansi_c_language);
  register_language(new_cpp_language);

  //
  // command line options
  //

  optionst options;
  get_command_line_options(options);

  eval_verbosity();

  goto_functionst goto_functions;

  if(get_goto_program(options, goto_functions))
    return 6;
    
  label_properties(goto_functions);

  if(cmdline.isset("show-properties"))
  {
    const namespacet ns(symbol_table);
    show_properties(ns, get_ui(), goto_functions);
    return 0;
  }

  if(set_properties(goto_functions))
    return 7;
    
  if(cmdline.isset("show-locs"))
  {
    const namespacet ns(symbol_table);
    locst locs(ns);
    locs.build(goto_functions);
    locs.output(std::cout);    
    return 0;
  }

  // do actual Symex

  try
  {
    const namespacet ns(symbol_table);
    path_searcht path_search(ns);
    
    path_search.set_message_handler(get_message_handler());

    if(cmdline.isset("depth"))
      path_search.set_depth_limit(unsafe_string2unsigned(cmdline.get_value("depth")));

    if(cmdline.isset("context-bound"))
      path_search.set_context_bound(unsafe_string2unsigned(cmdline.get_value("context-bound")));

    if(cmdline.isset("unwind"))
      path_search.set_unwind_limit(unsafe_string2unsigned(cmdline.get_value("unwind")));

    if(cmdline.isset("show-vcc"))
    {
      path_search.show_vcc=true;
      path_search(goto_functions);
      return 0;
    }

    // do actual symex
    switch(path_search(goto_functions))
    {
    case safety_checkert::SAFE:
      report_properties(path_search.property_map);
      report_success();
      return 0;
    
    case safety_checkert::UNSAFE:
      report_properties(path_search.property_map);
      report_failure();
      return 10;
    
    default:
      return 8;
    }
  }
  
  catch(const std::string error_msg)
  {
    error() << error_msg << messaget::eom;
    return 8;
  }

  catch(const char *error_msg)
  {
    error() << error_msg << messaget::eom;
    return 8;
  }

  #if 0                                         
  // let's log some more statistics
  debug() << "Memory consumption:" << messaget::endl;
  memory_info(debug());
  debug() << eom;
  #endif
}
Exemple #5
0
DialogEvt::DialogEvt(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
    wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER)
{
    // begin wxGlade: DialogEvt::DialogEvt
    nbPage = new wxNotebook(this, wxID_ANY);
    pnPage = new wxPanel(nbPage, wxID_ANY);
    szStartingConditions_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Starting Conditions"));
    szGraphic_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Selected graphic"));
    szMovement_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Movement type"));
    szTrigger_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Starting trigger"));
    szPriority_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Priority"));
    szAnimation_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Animation type"));
    szSpeed_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Scroll speed"));
    szEvtCmd_staticbox = new wxStaticBox(pnPage, wxID_ANY, _("Event commands"));
    szName_staticbox = new wxStaticBox(this, wxID_ANY, _("Name"));
    stName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
    btnNewPage = new wxButton(this, wxID_ANY, _("New page"));
    btnCopyPage = new wxButton(this, wxID_ANY, _("Copy page"));
    btnPastePage = new wxButton(this, wxID_ANY, _("Paste page"));
    btnDeletePage = new wxButton(this, wxID_ANY, _("Delete page"));
    chbSwitchA = new wxCheckBox(pnPage, wxID_ANY, _("Switch"));
    tcSwitchA = new wxTextCtrl(pnPage, wxID_ANY, wxEmptyString);
    btnSwitchA = new wxButton(pnPage, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
    stSwitchA = new wxStaticText(pnPage, wxID_ANY, _("ON"));
    chbSwitchB = new wxCheckBox(pnPage, wxID_ANY, _("Switch"));
    tcSwitchB = new wxTextCtrl(pnPage, wxID_ANY, wxEmptyString);
    btnSwitchB = new wxButton(pnPage, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
    stSwitchB = new wxStaticText(pnPage, wxID_ANY, _("ON"));
    chbVariable = new wxCheckBox(pnPage, wxID_ANY, _("Variable"));
    tcVariable = new wxTextCtrl(pnPage, wxID_ANY, wxEmptyString);
    btnVariable = new wxButton(pnPage, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
    stVariable1 = new wxStaticText(pnPage, wxID_ANY, _("Above"));
    spinVariable = new wxSpinCtrl(pnPage, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100);
    stVariable2 = new wxStaticText(pnPage, wxID_ANY, _("."));
    chbObject = new wxCheckBox(pnPage, wxID_ANY, _("Object"));
    const wxString chObject_choices[] = {
        _("<set by wxGlade>"),
    };
    chObject = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chObject_choices);
    stObject = new wxStaticText(pnPage, wxID_ANY, _("On hold"));
    chbActor = new wxCheckBox(pnPage, wxID_ANY, _("Actor"));
    const wxString chActor_choices[] = {
        _("<set by wxGlade>"),
    };
    chActor = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chActor_choices);
    stActor = new wxStaticText(pnPage, wxID_ANY, _("In party"));
    chbTimer = new wxCheckBox(pnPage, wxID_ANY, _("Timer"));
    spinTimerMinutes = new wxSpinCtrl(pnPage, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100);
    stTimerColon = new wxStaticText(pnPage, wxID_ANY, _(":"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
    spinTimerSeconds = new wxSpinCtrl(pnPage, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 59);
    stTimer = new wxStaticText(pnPage, wxID_ANY, _("Remaining"));
    bmpGraphic = new wxStaticBitmap(pnPage, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN);
    chbGraphicTranslucent = new wxCheckBox(pnPage, wxID_ANY, _("Translucent"));
    btnGraphic = new wxButton(pnPage, wxID_ANY, _("Select..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
    const wxString chMovement_choices[] = {
        _("<set by wxGlade>"),
    };
    chMovement = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chMovement_choices);
    stMovementRate = new wxStaticText(pnPage, wxID_ANY, _("Rate:"));
    const wxString chMovementRate_choices[] = {
        _("<set by wxGlade>"),
    };
    chMovementRate = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chMovementRate_choices);
    btnMovementCreatePath = new wxButton(pnPage, wxID_ANY, _("Create path"));
    const wxString chTrigger_choices[] = {
        _("<set by wxGlade>"),
    };
    chTrigger = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chTrigger_choices);
    const wxString chPriority_choices[] = {
        _("<set by wxGlade>"),
    };
    chPriority = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chPriority_choices);
    chOverlap = new wxCheckBox(pnPage, wxID_ANY, _("Allow overlap"));
    const wxString chAnimation_choices[] = {
        _("<set by wxGlade>"),
    };
    chAnimation = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chAnimation_choices);
    const wxString chSpeed_choices[] = {
        _("<set by wxGlade>"),
    };
    chSpeed = new wxChoice(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, chSpeed_choices);
    const wxString listEvtCmd_choices[] = {
        _("<>"),
    };
    listEvtCmd = new wxListBox(pnPage, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, listEvtCmd_choices, wxLB_SINGLE);
    btnOK = new wxButton(this, wxID_OK, wxEmptyString);
    btnCancel = new wxButton(this, wxID_CANCEL, wxEmptyString);
    btnApply = new wxButton(this, wxID_APPLY, wxEmptyString);
    btnHelp = new wxButton(this, wxID_HELP, wxEmptyString);

    set_properties();
    do_layout();
    // end wxGlade
}
Exemple #6
0
bool RH_RF24::init()
{
    if (!RHSPIDriver::init())
	return false;

    // Determine the interrupt number that corresponds to the interruptPin
    int interruptNumber = digitalPinToInterrupt(_interruptPin);
    if (interruptNumber == NOT_AN_INTERRUPT)
	return false;
#ifdef RH_ATTACHINTERRUPT_TAKES_PIN_NUMBER
    interruptNumber = _interruptPin;
#endif

    // Tell the low level SPI interface we will use SPI within this interrupt
    spiUsingInterrupt(interruptNumber);

    // Initialise the radio
    power_on_reset();
    cmd_clear_all_interrupts();

    // Get the device type and check it
    // This also tests whether we are really connected to a device
    uint8_t buf[8];
    if (!command(RH_RF24_CMD_PART_INFO, 0, 0, buf, sizeof(buf)))
	return false; // SPI error? Not connected?
    _deviceType = (buf[1] << 8) | buf[2];
    // Check PART to be either 0x4460, 0x4461, 0x4463, 0x4464
    if (_deviceType != 0x4460 &&
	_deviceType != 0x4461 &&
	_deviceType != 0x4463 &&
	_deviceType != 0x4464)
	return false; // Unknown radio type, or not connected

    // Here we use a configuration generated by the Silicon Labs Wireless Development Suite
    // #included above
    // We override a few things later that we ned to be sure of.
    configure(RF24_CONFIGURATION_DATA);

    // Add by Adrien van den Bossche <*****@*****.**> for Teensy
    // ARM M4 requires the below. else pin interrupt doesn't work properly.
    // On all other platforms, its innocuous, belt and braces
    pinMode(_interruptPin, INPUT); 

    // Set up interrupt handler
    // Since there are a limited number of interrupt glue functions isr*() available,
    // we can only support a limited number of devices simultaneously
    // ON some devices, notably most Arduinos, the interrupt pin passed in is actuallt the 
    // interrupt number. You have to figure out the interruptnumber-to-interruptpin mapping
    // yourself based on knwledge of what Arduino board you are running on.
    if (_myInterruptIndex == 0xff)
    {
	// First run, no interrupt allocated yet
	if (_interruptCount <= RH_RF24_NUM_INTERRUPTS)
	    _myInterruptIndex = _interruptCount++;
	else
	    return false; // Too many devices, not enough interrupt vectors
    }
    _deviceForInterrupt[_myInterruptIndex] = this;
    if (_myInterruptIndex == 0)
	attachInterrupt(interruptNumber, isr0, FALLING);
    else if (_myInterruptIndex == 1)
	attachInterrupt(interruptNumber, isr1, FALLING);
    else if (_myInterruptIndex == 2)
	attachInterrupt(interruptNumber, isr2, FALLING);
    else
	return false; // Too many devices, not enough interrupt vectors

    // Ensure we get the interrupts we need, irrespective of whats in the radio_config
    uint8_t int_ctl[] = {RH_RF24_MODEM_INT_STATUS_EN | RH_RF24_PH_INT_STATUS_EN, 0xff, 0xff, 0x00 };
    set_properties(RH_RF24_PROPERTY_INT_CTL_ENABLE, int_ctl, sizeof(int_ctl));

    // RSSI Latching should be configured in MODEM_RSSI_CONTROL in radio_config

    // PKT_TX_THRESHOLD and PKT_RX_THRESHOLD should be set to about 0x30 in radio_config

    // Configure important RH_RF24 registers
    // Here we set up the standard packet format for use by the RH_RF24 library:
    // We will use FIFO Mode, with automatic packet generation
    // We have 2 fields:
    // Field 1 contains only the (variable) length of field 2, with CRC
    // Field 2 contains the variable length payload and the CRC
    // Hmmm, having no CRC on field 1 and CRC on field 2 causes CRC errors when resetting after an odd
    // number of packets! Anyway its prob a good thing at the cost of some airtime.
    // Hmmm, enabling WHITEN stops it working!
    uint8_t pkt_config1[] = { 0x00 };
    set_properties(RH_RF24_PROPERTY_PKT_CONFIG1, pkt_config1, sizeof(pkt_config1));

    uint8_t pkt_len[] = { 0x02, 0x01, 0x00 };
    set_properties(RH_RF24_PROPERTY_PKT_LEN, pkt_len, sizeof(pkt_len));

    uint8_t pkt_field1[] = { 0x00, 0x01, 0x00, RH_RF24_FIELD_CONFIG_CRC_START | RH_RF24_FIELD_CONFIG_SEND_CRC | RH_RF24_FIELD_CONFIG_CHECK_CRC | RH_RF24_FIELD_CONFIG_CRC_ENABLE };
    set_properties(RH_RF24_PROPERTY_PKT_FIELD_1_LENGTH_12_8, pkt_field1, sizeof(pkt_field1));

    uint8_t pkt_field2[] = { 0x00, sizeof(_buf), 0x00, RH_RF24_FIELD_CONFIG_CRC_START | RH_RF24_FIELD_CONFIG_SEND_CRC | RH_RF24_FIELD_CONFIG_CHECK_CRC | RH_RF24_FIELD_CONFIG_CRC_ENABLE };
    set_properties(RH_RF24_PROPERTY_PKT_FIELD_2_LENGTH_12_8, pkt_field2, sizeof(pkt_field2));

    // Clear all other fields so they are never used, irrespective of the radio_config
    uint8_t pkt_fieldn[] = { 0x00, 0x00, 0x00, 0x00 };
    set_properties(RH_RF24_PROPERTY_PKT_FIELD_3_LENGTH_12_8, pkt_fieldn, sizeof(pkt_fieldn));
    set_properties(RH_RF24_PROPERTY_PKT_FIELD_4_LENGTH_12_8, pkt_fieldn, sizeof(pkt_fieldn));
    set_properties(RH_RF24_PROPERTY_PKT_FIELD_5_LENGTH_12_8, pkt_fieldn, sizeof(pkt_fieldn));

    // The following can be changed later by the user if necessary.
    // Set up default configuration
    setCRCPolynomial(CRC_16_IBM);
    uint8_t syncwords[] = { 0x2d, 0xd4 };
    setSyncWords(syncwords, sizeof(syncwords)); // Same as RF22's
    // 3 would be sufficient, but this is the same as RF22's
    // actualy, 4 seems to work much better for some modulations
    setPreambleLength(4);
    // Default freq comes from the radio config file
    // About 2.4dBm on RFM24:
    setTxPower(0x10); 

    return true;
}
Exemple #7
0
mpcomplex::mpcomplex( const long double& real, const long double& imag, const mp_prec_t &p, const mp_rnd_t &r ) {
    set_properties( r, p );
    init();
    mpc_set_d_d( mpc_val , real, imag , mpc_prec );
}
Exemple #8
0
bool RH_RF24::setFrequency(float centre, float afcPullInRange)
{
    // See Si446x Data Sheet section 5.3.1
    // Also the Si446x PLL Synthesizer / VCO_CNT Calculator Rev 0.4
    uint8_t outdiv;
    uint8_t band;
    if (_deviceType == 0x4460 ||
	_deviceType == 0x4461 ||
	_deviceType == 0x4463)
    {
	// Non-continuous frequency bands
	if (centre <= 1050.0 && centre >= 850.0)
	    outdiv = 4, band = 0;
	else if (centre <= 525.0 && centre >= 425.0)
	    outdiv = 8, band = 2;
	else if (centre <= 350.0 && centre >= 284.0)
	    outdiv = 12, band = 3;
	else if (centre <= 175.0 && centre >= 142.0)
	    outdiv = 24, band = 5;
	else 
	    return false;
    }
    else
    {
	// 0x4464
	// Continuous frequency bands
	if (centre <= 960.0 && centre >= 675.0)
	    outdiv = 4, band = 1;
	else if (centre < 675.0 && centre >= 450.0)
	    outdiv = 6, band = 2;
	else if (centre < 450.0 && centre >= 338.0)
	    outdiv = 8, band = 3;
	else if (centre < 338.0 && centre >= 225.0)
	    outdiv = 12, band = 4;
	else if (centre < 225.0 && centre >= 169.0)
	    outdiv = 16, band = 4;
	else if (centre < 169.0 && centre >= 119.0)
	    outdiv = 24, band = 5;
	else 
	    return false;
    }

    // Set the MODEM_CLKGEN_BAND (not documented)
    uint8_t modem_clkgen[] = { band+8 };
    if (!set_properties(RH_RF24_PROPERTY_MODEM_CLKGEN_BAND, modem_clkgen, sizeof(modem_clkgen)))
	return false;

    centre *= 1000000.0; // Convert to Hz

    // Now generate the RF frequency properties
    // Need the Xtal/XO freq from the radio_config file:
    uint32_t xtal_frequency[1] = RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ;
    unsigned long f_pfd = 2 * xtal_frequency[0] / outdiv;
    unsigned int n = ((unsigned int)(centre / f_pfd)) - 1;
    float ratio = centre / (float)f_pfd;
    float rest  = ratio - (float)n;
    unsigned long m = (unsigned long)(rest * 524288UL); 
    unsigned int m2 = m / 0x10000;
    unsigned int m1 = (m - m2 * 0x10000) / 0x100;
    unsigned int m0 = (m - m2 * 0x10000 - m1 * 0x100); 

    // PROP_FREQ_CONTROL_GROUP
    uint8_t freq_control[] = { n, m2, m1, m0 };
    return set_properties(RH_RF24_PROPERTY_FREQ_CONTROL_INTE, freq_control, sizeof(freq_control));
}
Exemple #9
0
mpcomplex::mpcomplex() { 
    set_properties( default_rnd, default_prec );
    init();
    mpc_set_ui(mpc_val,0, default_prec);
}
Exemple #10
0
mpcomplex::mpcomplex( const mpc_t& num, const mp_prec_t &p, const mp_rnd_t &r ) {
    set_properties( r, p );
    init();
    mpc_set( mpc_val , num , mpc_prec );
}
Exemple #11
0
void set_properties(
  goto_modelt &goto_model,
  const std::list<std::string> &properties)
{
  set_properties(goto_model.goto_functions, properties);
}
Exemple #12
0
WFileProperties::WFileProperties(WCryptoTE* parent, int _subfileid, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long WXUNUSED(style))
    : wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxTHICK_FRAME),
      wmain(parent), subfileid(_subfileid)
{
    SetMinSize(wxSize(350, 0));

    // begin wxGlade: WFileProperties::WFileProperties
    textIdentifier = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    textFilename = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
    textAuthor = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
    textSize = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    textCompressed = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    textCTime = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    textMTime = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
    const wxString choiceType_choices[] = {
        _("Binary Data"),
        _("Text File"),
        _("Image File")
    };
    choiceType = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 3, choiceType_choices, 0);
    const wxString choiceCompression_choices[] = {
        _("None"),
        _("ZLib"),
        _("BZ2")
    };
    choiceCompression = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 3, choiceCompression_choices, 0);
    const wxString choiceEncryption_choices[] = {
        _("None (Don't Use)"),
        _("Serpent 256 keybits")
    };
    choiceEncryption = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 2, choiceEncryption_choices, 0);
    textSubject = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
    textDescription = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
    buttonOK = new wxButton(this, wxID_OK, wxEmptyString);
    buttonCancel = new wxButton(this, wxID_CANCEL, wxEmptyString);

    set_properties();
    do_layout();
    // end wxGlade

    Enctain::Container cnt = wmain->container;

    if (subfileid < 0) return;

    textIdentifier->SetValue(wxString::Format(_T("%u"), subfileid));
    SetTitle(wxString::Format(_("Properties of SubFile %u"), subfileid));

    textFilename->SetValue(strSTL2WX(cnt.GetSubFileProperty(subfileid, "Name")));
    textAuthor->SetValue(strSTL2WX(cnt.GetSubFileProperty(subfileid, "Author")));

    textSize->SetValue(wxString::Format(_T("%u"), cnt.GetSubFileSize(subfileid)));
    textCompressed->SetValue(wxString::Format(_T("%u"), cnt.GetSubFileStorageSize(subfileid)));

    std::string timestr = cnt.GetSubFileProperty(subfileid, "CTime");
    if (timestr.size() == sizeof(time_t)) {
        wxDateTime ctime(*(time_t*)timestr.data());
        textCTime->SetValue(ctime.Format(_("%c")));
    }

    timestr = cnt.GetSubFileProperty(subfileid, "MTime");
    if (timestr.size() == sizeof(time_t)) {
        wxDateTime mtime(*(time_t*)timestr.data());
        textMTime->SetValue(mtime.Format(_("%c")));
    }

    const std::string& filetype = cnt.GetSubFileProperty(subfileid, "Filetype");
    if (filetype == "text") {
        choiceType->SetSelection(1);
    }
    else {
        choiceType->SetSelection(0);
    }

    choiceCompression->SetSelection(cnt.GetSubFileCompression(subfileid));
    choiceEncryption->SetSelection(cnt.GetSubFileEncryption(subfileid));

    textSubject->SetValue(strSTL2WX(cnt.GetSubFileProperty(subfileid, "Subject")));
    textDescription->SetValue(strSTL2WX(cnt.GetSubFileProperty(subfileid, "Description")));

    textFilename->SetFocus();
}
DebuggerRegistersView::DebuggerRegistersView(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
	wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
	// begin wxGlade: DebuggerRegistersView::DebuggerRegistersView
	panel_2 = new wxPanel(this, wxID_ANY);
	label_1 = new wxStaticText(panel_2, wxID_ANY, _("General registers:"));
	label_af = new wxStaticText(panel_2, wxID_ANY, _("AF"));
	reg_af = new wxTextCtrl(panel_2, REGISTER_AF, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_af2 = new wxStaticText(panel_2, wxID_ANY, _("AF'"));
	reg_af2 = new wxTextCtrl(panel_2, REGISTER_AF2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_bc = new wxStaticText(panel_2, wxID_ANY, _("BC"));
	reg_bc = new wxTextCtrl(panel_2, REGISTER_BC, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_bc2 = new wxStaticText(panel_2, wxID_ANY, _("BC'"));
	reg_bc2 = new wxTextCtrl(panel_2, REGISTER_BC2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_de = new wxStaticText(panel_2, wxID_ANY, _("DE"));
	reg_de = new wxTextCtrl(panel_2, REGISTER_DE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_de2 = new wxStaticText(panel_2, wxID_ANY, _("DE'"));
	reg_de2 = new wxTextCtrl(panel_2, REGISTER_DE2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_hl = new wxStaticText(panel_2, wxID_ANY, _("HL"));
	reg_hl = new wxTextCtrl(panel_2, REGISTER_HL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_hl2 = new wxStaticText(panel_2, wxID_ANY, _("HL'"));
	reg_hl2 = new wxTextCtrl(panel_2, REGISTER_HL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_2 = new wxStaticText(panel_2, wxID_ANY, _("Program Counter and Stack Pointer:"));
	label_pc = new wxStaticText(panel_2, wxID_ANY, _("PC"));
	reg_pc = new wxTextCtrl(panel_2, REGISTER_PC, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_sp = new wxStaticText(panel_2, wxID_ANY, _("SP"));
	reg_sp = new wxTextCtrl(panel_2, REGISTER_SP, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_3 = new wxStaticText(panel_2, wxID_ANY, _("Index registers:"));
	label_ix = new wxStaticText(panel_2, wxID_ANY, _("IX"));
	reg_ix = new wxTextCtrl(panel_2, REGISTER_IX, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_iy = new wxStaticText(panel_2, wxID_ANY, _("IY"));
	reg_iy = new wxTextCtrl(panel_2, REGISTER_IY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_4 = new wxStaticText(panel_2, wxID_ANY, _("Interrupt Page and Memory Refresh:"));
	label_i = new wxStaticText(panel_2, wxID_ANY, _("I"));
	reg_i = new wxTextCtrl(panel_2, REGISTER_I, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_r = new wxStaticText(panel_2, wxID_ANY, _("R"));
	reg_r = new wxTextCtrl(panel_2, REGISTER_R, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
	label_5 = new wxStaticText(panel_2, wxID_ANY, _("Flags:"));
	label_9 = new wxStaticText(panel_2, wxID_ANY, _("S"));
	label_10 = new wxStaticText(panel_2, wxID_ANY, _("Z"));
	label_11 = new wxStaticText(panel_2, wxID_ANY, _("Y"));
	label_12 = new wxStaticText(panel_2, wxID_ANY, _("H"));
	label_13 = new wxStaticText(panel_2, wxID_ANY, _("X"));
	label_14 = new wxStaticText(panel_2, wxID_ANY, _("P"));
	label_15 = new wxStaticText(panel_2, wxID_ANY, _("N"));
	label_16 = new wxStaticText(panel_2, wxID_ANY, _("C"));
	checkbox_flag_s = new wxCheckBox(panel_2, FLAG_S, wxEmptyString);
	checkbox_flag_z = new wxCheckBox(panel_2, FLAG_Z, wxEmptyString);
	checkbox_flag_y = new wxCheckBox(panel_2, FLAG_Y, wxEmptyString);
	checkbox_flag_h = new wxCheckBox(panel_2, FLAG_H, wxEmptyString);
	checkbox_flag_x = new wxCheckBox(panel_2, FLAG_X, wxEmptyString);
	checkbox_flag_p = new wxCheckBox(panel_2, FLAG_P, wxEmptyString);
	checkbox_flag_n = new wxCheckBox(panel_2, FLAG_N, wxEmptyString);
	checkbox_flag_c = new wxCheckBox(panel_2, FLAG_C, wxEmptyString);
	panel_1 = new wxPanel(panel_2, wxID_ANY);

	set_properties();
	do_layout();
	// end wxGlade

	debugger = NULL;
}
Exemple #14
0
FrameEditor::FrameEditor(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
    wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
    // begin wxGlade: FrameEditor::FrameEditor
    swEditor = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER);
    pnEditorMapTree = new wxPanel(swEditor, wxID_ANY);
    frmEditorMenubar = new wxMenuBar();
    wxMenu* MenuProject = new wxMenu();
    MenuProject->Append(wxID_NEW, _("&New..."), _("Create a new project"), wxITEM_NORMAL);
    MenuProject->Append(wxID_OPEN, _("&Open..."), _("Open an existing project"), wxITEM_NORMAL);
    MenuProject->Append(wxID_CLOSE, _("&Close"), _("Close the current project"), wxITEM_NORMAL);
    MenuProject->AppendSeparator();
    MenuProject->Append(wxID_ANY, _("&Make game disk..."), _("Compress game data and create a distributable file"), wxITEM_NORMAL);
    MenuProject->AppendSeparator();
    MenuProject->Append(wxID_EXIT, _("&Exit"), _("Exit EasyRPG"), wxITEM_NORMAL);
    frmEditorMenubar->Append(MenuProject, _("&Project"));
    wxMenu* wxglade_tmp_menu_1 = new wxMenu();
    wxglade_tmp_menu_1->Append(wxID_SAVE, _("&Save"), _("Save all changes in the project maps"), wxITEM_NORMAL);
    wxglade_tmp_menu_1->Append(wxID_REVERT, _("&Revert"), _("Discard all changes and reload the saved project maps"), wxITEM_NORMAL);
    wxglade_tmp_menu_1->AppendSeparator();
    wxMenu* MenuEdit = new wxMenu();
    MenuEdit->Append(wxID_ANY, _("&Lower layer"), _("Switch to the lower layer map editing mode"), wxITEM_RADIO);
    MenuEdit->Append(wxID_ANY, _("&Upper layer"), _("Switch to the upper layer map editing mode"), wxITEM_RADIO);
    MenuEdit->Append(wxID_ANY, _("&Events"), _("Switch to the event layer map editing mode"), wxITEM_RADIO);
    wxglade_tmp_menu_1->Append(wxID_ANY, _("&Edit"), MenuEdit, wxEmptyString);
    wxMenu* MenuScale = new wxMenu();
    MenuScale->Append(wxID_ZOOM_100, _("1:&1"), _("Display the map in 1:1 scale"), wxITEM_RADIO);
    MenuScale->Append(wxID_ANY, _("1:&2"), _("Display the map in 1:2 scale"), wxITEM_RADIO);
    MenuScale->Append(wxID_ANY, _("1:&4"), _("Display the map in 1:4 scale"), wxITEM_RADIO);
    MenuScale->Append(wxID_ANY, _("1:&8"), _("Display the map in 1:8 scale"), wxITEM_RADIO);
    wxglade_tmp_menu_1->Append(wxID_ANY, _("&Scale"), MenuScale, wxEmptyString);
    frmEditorMenubar->Append(wxglade_tmp_menu_1, _("&Map"));
    wxMenu* MenuTools = new wxMenu();
    MenuTools->Append(wxID_ANY, _("&Database"), _("Open the project database editor window"), wxITEM_NORMAL);
    MenuTools->Append(wxID_ANY, _("&Material manager"), _("Add or remove material from the project"), wxITEM_NORMAL);
    MenuTools->Append(wxID_ANY, _("Music &player"), _("Play background music while editing"), wxITEM_NORMAL);
    frmEditorMenubar->Append(MenuTools, _("&Tools"));
    wxMenu* MenuGame = new wxMenu();
    MenuGame->Append(wxID_ANY, _("&Play test"), _("Launch the game project for testing"), wxITEM_NORMAL);
    MenuGame->AppendSeparator();
    MenuGame->Append(wxID_ANY, _("&Full screen"), _("Enable or disable full screen in play test"), wxITEM_CHECK);
    MenuGame->Append(wxID_ANY, _("&Show title"), _("Enable or disable background and music in the title in play test"), wxITEM_CHECK);
    frmEditorMenubar->Append(MenuGame, _("&Game"));
    wxMenu* MenuHelp = new wxMenu();
    MenuHelp->Append(wxID_HELP, _("&Index"), _("Display the help index and contents of EasyRPG"), wxITEM_NORMAL);
    MenuHelp->AppendSeparator();
    MenuHelp->Append(wxID_ABOUT, _("&About"), _("About EasyRPG Editor"), wxITEM_NORMAL);
    frmEditorMenubar->Append(MenuHelp, _("&Help"));
    SetMenuBar(frmEditorMenubar);
    frmEditorStatusbar = CreateStatusBar(1);
    frmEditorToolbar = new wxToolBar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_FLAT);
    SetToolBar(frmEditorToolbar);
    frmEditorToolbar->AddTool(wxID_NEW, _("New"), wxBitmap(wxT("../share/toolbar/new.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("New project"), _("Create a new project"));
    frmEditorToolbar->AddTool(wxID_OPEN, _("Open"), wxBitmap(wxT("../share/toolbar/open.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Open project"), _("Open an existing project"));
    frmEditorToolbar->AddTool(wxID_CLOSE, _("Close"), wxBitmap(wxT("../share/toolbar/close.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Close project"), _("Close the current project"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Make game disk"), wxBitmap(wxT("../share/toolbar/makegamedisk.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Make game disk "), _("Make a redistributable package from the current project"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_SAVE, _("Save"), wxBitmap(wxT("../share/toolbar/save.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Save map changes"), _("Save all changes in the project maps"));
    frmEditorToolbar->AddTool(wxID_REVERT, _("Revert"), wxBitmap(wxT("../share/toolbar/revert.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Revert map changes"), _("Discard all changes and reload the saved project maps"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Lower layer"), wxBitmap(wxT("../share/toolbar/lowerlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Lower layer editing"), _("Switch to the lower layer map editing mode"));
    frmEditorToolbar->AddTool(wxID_ANY, _("Upper layer"), wxBitmap(wxT("../share/toolbar/upperlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Upper layer editing"), _("Switch to the upper layer map editing mode"));
    frmEditorToolbar->AddTool(wxID_ANY, _("Events"), wxBitmap(wxT("../share/toolbar/eventlayer.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("Event layer editing"), _("Switch to the event layer map editing mode"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ZOOM_100, _("1:1"), wxBitmap(wxT("../share/toolbar/11scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:1 scale"), _("Display the map in 1:1 scale"));
    frmEditorToolbar->AddTool(wxID_ANY, _("1:2"), wxBitmap(wxT("../share/toolbar/12scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:2 scale"), _("Display the map in 1:2 scale"));
    frmEditorToolbar->AddTool(wxID_ANY, _("1:4"), wxBitmap(wxT("../share/toolbar/14scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:4 scale"), _("Display the map in 1:4 scale"));
    frmEditorToolbar->AddTool(wxID_ANY, _("1:8"), wxBitmap(wxT("../share/toolbar/18scale.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_RADIO, _("1:8 scale"), _("Display the map in 1:8 scale"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Database"), wxBitmap(wxT("../share/toolbar/database.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Database editor"), _("Open the project database editor window"));
    frmEditorToolbar->AddTool(wxID_ANY, _("Material"), wxBitmap(wxT("../share/toolbar/material.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Material manager"), _("Add or remove material from the project"));
    frmEditorToolbar->AddTool(wxID_ANY, _("Music"), wxBitmap(wxT("../share/toolbar/music.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Music player"), _("Play background music while editing"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Play test"), wxBitmap(wxT("../share/toolbar/playtest.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Play test"), _("Launch the game project for testing"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Full screen"), wxBitmap(wxT("../share/toolbar/fullscreen.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_CHECK, _("Full screen"), _("Enable or disable full screen in play test"));
    frmEditorToolbar->AddTool(wxID_ANY, _("Title"), wxBitmap(wxT("../share/toolbar/title.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_CHECK, _("Show title"), _("Enable or disable background and music in the title in play test"));
    frmEditorToolbar->AddSeparator();
    frmEditorToolbar->AddTool(wxID_ANY, _("Help"), wxBitmap(wxT("../share/toolbar/help.png"), wxBITMAP_TYPE_ANY), wxNullBitmap, wxITEM_NORMAL, _("Help contents"), _("Display the help index and contents of EasyRPG"));
    frmEditorToolbar->Realize();
    pnEditorTileset = new wxScrolledWindow(swEditor, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
    tcMapTree = new wxTreeCtrl(pnEditorMapTree, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN|wxTR_DEFAULT_STYLE|wxTR_HAS_BUTTONS|wxTR_NO_LINES);
    pnEditorMap = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);

    set_properties();
    do_layout();
    // end wxGlade
}
Exemple #15
0
mpcomplex::mpcomplex( const mpfr_t& real, const mp_prec_t &p, const mp_rnd_t &r ) {
    set_properties( r, p );
    init();
    mpc_set_fr(mpc_val, real, mpc_prec);
}
Exemple #16
0
// Sets registers from a canned modem configuration structure
void RH_RF24::setModemRegisters(const ModemConfig* config)
{
    // This list also generated with convert.pl
    set_properties(0x2000, &config->prop_2000, 1);
    set_properties(0x2003, &config->prop_2003, 1);
    set_properties(0x2004, &config->prop_2004, 1);
    set_properties(0x2005, &config->prop_2005, 1);
    set_properties(0x2006, &config->prop_2006, 1);
    set_properties(0x200b, &config->prop_200b, 1);
    set_properties(0x200c, &config->prop_200c, 1);
    set_properties(0x2018, &config->prop_2018, 1);
    set_properties(0x201e, &config->prop_201e, 1);
    set_properties(0x201f, &config->prop_201f, 1);
    set_properties(0x2022, &config->prop_2022, 1);
    set_properties(0x2023, &config->prop_2023, 1);
    set_properties(0x2024, &config->prop_2024, 1);
    set_properties(0x2025, &config->prop_2025, 1);
    set_properties(0x2026, &config->prop_2026, 1);
    set_properties(0x2027, &config->prop_2027, 1);
    set_properties(0x2028, &config->prop_2028, 1);
    set_properties(0x2029, &config->prop_2029, 1);
    set_properties(0x202d, &config->prop_202d, 1);
    set_properties(0x202e, &config->prop_202e, 1);
    set_properties(0x202f, &config->prop_202f, 1);
    set_properties(0x2030, &config->prop_2030, 1);
    set_properties(0x2031, &config->prop_2031, 1);
    set_properties(0x2035, &config->prop_2035, 1);
    set_properties(0x2038, &config->prop_2038, 1);
    set_properties(0x2039, &config->prop_2039, 1);
    set_properties(0x203a, &config->prop_203a, 1);
    set_properties(0x203b, &config->prop_203b, 1);
    set_properties(0x203c, &config->prop_203c, 1);
    set_properties(0x203d, &config->prop_203d, 1);
    set_properties(0x203e, &config->prop_203e, 1);
    set_properties(0x203f, &config->prop_203f, 1);
    set_properties(0x2040, &config->prop_2040, 1);
    set_properties(0x2043, &config->prop_2043, 1);
    set_properties(0x2045, &config->prop_2045, 1);
    set_properties(0x2046, &config->prop_2046, 1);
    set_properties(0x2047, &config->prop_2047, 1);
    set_properties(0x204e, &config->prop_204e, 1);
    set_properties(0x2100, &config->prop_2100, 1);
    set_properties(0x2101, &config->prop_2101, 1);
    set_properties(0x2102, &config->prop_2102, 1);
    set_properties(0x2103, &config->prop_2103, 1);
    set_properties(0x2104, &config->prop_2104, 1);
    set_properties(0x2105, &config->prop_2105, 1);
    set_properties(0x2106, &config->prop_2106, 1);
    set_properties(0x2107, &config->prop_2107, 1);
    set_properties(0x2108, &config->prop_2108, 1);
    set_properties(0x2109, &config->prop_2109, 1);
    set_properties(0x210a, &config->prop_210a, 1);
    set_properties(0x210b, &config->prop_210b, 1);
    set_properties(0x210c, &config->prop_210c, 1);
    set_properties(0x210d, &config->prop_210d, 1);
    set_properties(0x210e, &config->prop_210e, 1);
    set_properties(0x210f, &config->prop_210f, 1);
    set_properties(0x2110, &config->prop_2110, 1);
    set_properties(0x2111, &config->prop_2111, 1);
    set_properties(0x2112, &config->prop_2112, 1);
    set_properties(0x2113, &config->prop_2113, 1);
    set_properties(0x2114, &config->prop_2114, 1);
    set_properties(0x2115, &config->prop_2115, 1);
    set_properties(0x2116, &config->prop_2116, 1);
    set_properties(0x2117, &config->prop_2117, 1);
    set_properties(0x2118, &config->prop_2118, 1);
    set_properties(0x2119, &config->prop_2119, 1);
    set_properties(0x211a, &config->prop_211a, 1);
    set_properties(0x211b, &config->prop_211b, 1);
    set_properties(0x211c, &config->prop_211c, 1);
    set_properties(0x211d, &config->prop_211d, 1);
    set_properties(0x211e, &config->prop_211e, 1);
    set_properties(0x211f, &config->prop_211f, 1);
    set_properties(0x2120, &config->prop_2120, 1);
    set_properties(0x2121, &config->prop_2121, 1);
    set_properties(0x2122, &config->prop_2122, 1);
    set_properties(0x2123, &config->prop_2123, 1);
    set_properties(0x2203, &config->prop_2203, 1);
    set_properties(0x2300, &config->prop_2300, 1);
    set_properties(0x2301, &config->prop_2301, 1);
    set_properties(0x2303, &config->prop_2303, 1);
    set_properties(0x2304, &config->prop_2304, 1);
    set_properties(0x2305, &config->prop_2305, 1);
}
Exemple #17
0
mpcomplex::mpcomplex( const mpcomplex &other, const mp_prec_t &p, const mp_rnd_t &r ) {
    set_properties( r, p );
    init();
    mpc_set( mpc_val , other.mpc_val , mpc_prec );
}
MainToolBar::MainToolBar(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style):
    wxToolBar(parent, id, pos, size, wxTB_FLAT | wxTB_TEXT | wxTB_NOICONS)
{
    set_properties();
    do_layout();
}
Exemple #19
0
mpcomplex::mpcomplex( char* num, const mp_prec_t &p, const mp_rnd_t &r ) {
    set_properties( r, p );
    init();
    mpc_set_str(mpc_val, num , 10, mpc_rnd);
}
Exemple #20
0
CFontPropertyPage::CFontPropertyPage(wxWindow* parent, wxFont &font, int id, const wxPoint& pos, const wxSize& size, long style)
 : CFontPropertyPageBase(parent, font, id, pos, size, wxTAB_TRAVERSAL)
{
    m_bUnderline = false;
    m_bStrikethrough = false;
    wxString text;
    text = "AaBbYyZz";
    style = style;
    m_font = font;
    if( m_font.IsOk() )
    {
        m_fontSize = wxString::Format( "%d", m_font.GetPointSize() );
        if( m_font.GetStyle() == wxFONTSTYLE_ITALIC && m_font.GetWeight() == wxFONTWEIGHT_BOLD )
            m_nCurrentStyle = NTM_ITALIC | NTM_BOLD;
        else if( m_font.GetStyle() == wxFONTSTYLE_ITALIC )
            m_nCurrentStyle = NTM_ITALIC;
        else if( m_font.GetWeight() == wxFONTWEIGHT_BOLD )
            m_nCurrentStyle = NTM_BOLD;
        else
            m_nCurrentStyle = NTM_REGULAR;
        if( m_font.GetUnderlined() )
            m_bUnderline = true;
        else
            m_bUnderline = false;
        if( m_font.GetStrikethrough() )
            m_bStrikethrough = true;
		else
            m_bStrikethrough = false;
    }
    else
    {
        m_fontSize = wxEmptyString;
        m_bUnderline = false;
        m_bStrikethrough = false;
    }
    m_nActualStyle = m_nCurrentStyle;
//    m_textStr = font.GetTextDescription();
//    m_backgroundStr = font.GetBackgroundDescription();
    itemStaticText6 = new wxStaticText( this, wxID_STATIC, _T( "&Font:" ), wxDefaultPosition, wxDefaultSize, 0 );
    itemChoice7 = new CFontNamesComboBox( this, wxID_ANY );
    itemStaticText9 = new wxStaticText( this, wxID_ANY, _T("Font St&yles:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemChoice10 = new CStyleComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SIMPLE );
    itemStaticText18 = new wxStaticText( this, wxID_ANY, _T("&Size:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemChoice19 = new CSizeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SIMPLE );
    itemCheckBox1 = new wxCheckBox( this, wxID_ANY, _T( "&Underline" ) );
    itemCheckBox2 = new wxCheckBox( this, wxID_ANY, _T( "Stri&keout" ) );
    itemStaticBox1 = new wxStaticBox( this, wxID_ANY, _T( "Effects" ) );
    itemStaticBox2 = new wxStaticBox( this, wxID_ANY, _T( "Sample" ) );
    itemStaticText15 = new wxStaticText( this, wxID_STATIC, _T( "&Text Color:" ), wxDefaultPosition, wxDefaultSize, 0 );
    itemChoice16 = new CColorComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize );
    itemStaticText23 = new wxStaticText( this, wxID_STATIC, _T("&Background:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemChoice17 = new CColorComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize );
    itemWindow24 = new wxFontPreviewer( this, font, text );
//    itemWindow24->SetMinSize( wxSize( 130, 32 ) );
    itemStaticText30 = new wxStaticText( this, wxID_STATIC, _T( "" ), wxDefaultPosition, wxDefaultSize, 0 );
    do_layout();
    set_properties();
    m_dirty = false;
    itemWindow24->SetFont( m_font );
    itemWindow24->Refresh();
    itemChoice7->Bind( wxEVT_COMBOBOX, &CFontPropertyPage::OnChangeFont, this );
    itemChoice10->Bind( wxEVT_COMBOBOX, &CFontPropertyPage::OnChangeFont, this );
    itemChoice19->Bind( wxEVT_COMBOBOX, &CFontPropertyPage::OnChangeFont, this );
    itemCheckBox2->Bind( wxEVT_CHECKBOX, &CFontPropertyPage::OnChangeFont, this );
    itemCheckBox1->Bind( wxEVT_CHECKBOX, &CFontPropertyPage::OnChangeFont, this );
}
Exemple #21
0
yaAcaFrameClass::yaAcaFrameClass(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
    wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE|wxCLOSE_BOX)
{
    GetParameters (ControllerNumber);
    Roll.CurrentAdjustedReading = 0;
    Roll.LastRawReading = 0;
    Pitch.CurrentAdjustedReading = 0;
    Pitch.LastRawReading = 0;
    Yaw.CurrentAdjustedReading = 0;
    Yaw.LastRawReading = 0;

    // begin wxGlade: yaAcaFrameClass::yaAcaFrameClass
    StatusPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ControllerPositionPanel_copy_1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ControllerPositionPanel_copy = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ControllerPitchPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    panel_1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ModelPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ControllerNumberPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    ControllerSizer_staticbox = new wxStaticBox(this, -1, wxT("Joystick Controller"));
    RollBox_staticbox = new wxStaticBox(this, -1, wxT("Roll Axis Configuration"));
    PitchBox_staticbox = new wxStaticBox(this, -1, wxT("Pitch Axis Configuration"));
    YawBox_staticbox = new wxStaticBox(this, -1, wxT("Yaw Axis Configuration"));
    panel_2 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL);
    label_4 = new wxStaticText(this, wxID_ANY, wxT("Drivers: "));
    ToolkitLabel = new wxStaticText(panel_2, wxID_ANY, wxT("0 (wxWidgets)"));
    label_1 = new wxStaticText(this, wxID_ANY, wxT("Controller: "));
    ControllerNumberLabel = new wxStaticText(ControllerNumberPanel, wxID_ANY, wxT("0"));
    label_1_copy_3 = new wxStaticText(this, wxID_ANY, wxT("Model: "));
    ControllerModelLabel = new wxStaticText(ModelPanel, wxID_ANY, wxT("(no joystick controller attached)"));
    label_3 = new wxStaticText(this, wxID_ANY, wxT("Axes: "));
    BoxAxis0 = new wxCheckBox(panel_1, wxID_ANY, wxT("0"));
    BoxAxis1 = new wxCheckBox(panel_1, wxID_ANY, wxT("1"));
    BoxAxis2 = new wxCheckBox(panel_1, wxID_ANY, wxT("2"));
    BoxAxis3 = new wxCheckBox(panel_1, wxID_ANY, wxT("3"));
    BoxAxis4 = new wxCheckBox(panel_1, wxID_ANY, wxT("4"));
    BoxAxis5 = new wxCheckBox(panel_1, wxID_ANY, wxT("5"));
    BoxAxis6 = new wxCheckBox(panel_1, wxID_ANY, wxT("6"));
    label_1_copy_1 = new wxStaticText(this, wxID_ANY, wxT("Pitch: "));
    ControllerPitchLabel = new wxStaticText(ControllerPitchPanel, wxID_ANY, wxT("0"));
    label_1_copy_4 = new wxStaticText(this, wxID_ANY, wxT("Roll: "));
    ControllerRollLabel = new wxStaticText(ControllerPositionPanel_copy, wxID_ANY, wxT("0"));
    label_1_copy = new wxStaticText(this, wxID_ANY, wxT("Yaw: "));
    ControllerYawLabel = new wxStaticText(ControllerPositionPanel_copy_1, wxID_ANY, wxT("0"));
    label_2 = new wxStaticText(this, wxID_ANY, wxT("Axis number: "));
    RollAxisCtrl = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 6);
    const wxString RollPolarityBox_choices[] = {
        wxT("Positive"),
        wxT("Negative")
    };
    RollPolarityBox = new wxRadioBox(this, wxID_ANY, wxT("Polarity"), wxDefaultPosition, wxDefaultSize, 2, RollPolarityBox_choices, 0, wxRA_SPECIFY_ROWS);
    label_2_copy = new wxStaticText(this, wxID_ANY, wxT("Axis number: "));
    PitchAxisCtrl = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 6);
    const wxString PitchPolarityBox_choices[] = {
        wxT("Positive"),
        wxT("Negative")
    };
    PitchPolarityBox = new wxRadioBox(this, wxID_ANY, wxT("Polarity"), wxDefaultPosition, wxDefaultSize, 2, PitchPolarityBox_choices, 0, wxRA_SPECIFY_ROWS);
    label_2_copy_1 = new wxStaticText(this, wxID_ANY, wxT("Axis number: "));
    YawAxisCtrl = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 6);
    const wxString YawPolarityBox_choices[] = {
        wxT("Positive"),
        wxT("Negative")
    };
    YawPolarityBox = new wxRadioBox(this, wxID_ANY, wxT("Polarity"), wxDefaultPosition, wxDefaultSize, 2, YawPolarityBox_choices, 0, wxRA_SPECIFY_ROWS);
    DefaultButton = new wxButton(this, ID_DEFAULT, wxT("Default"));
    SetButton = new wxButton(this, ID_SET, wxT("Set"));
    StatusLabel = new wxStaticText(StatusPanel, wxID_ANY, wxT("Waiting for connection to yaAGC ..."));

    set_properties();
    do_layout();
    // end wxGlade
    
    RollAxisCtrl->SetValue (Roll.Axis);
    RollPolarityBox->SetSelection (Roll.PositiveSense ? 0 : 1);
    PitchAxisCtrl->SetValue (Pitch.Axis);
    PitchPolarityBox->SetSelection (Pitch.PositiveSense ? 0 : 1);
    YawAxisCtrl->SetValue (Yaw.Axis);
    YawPolarityBox->SetSelection (Yaw.PositiveSense ? 0 : 1);
    ToolkitLabel->SetLabel (wxT ("wxWidgets"));
    wxString Dummy = wxString::Format (wxT ("%d"), ControllerNumber);
    ControllerNumberLabel->SetLabel (Dummy);
    ControllerModelLabel->SetLabel (wxT ("(no joystick controller attached)"));
    ControllerRollLabel->SetLabel (wxT ("(none)"));
    ControllerPitchLabel->SetLabel (wxT ("(none)"));
    ControllerYawLabel->SetLabel (wxT ("(none)"));
    BoxAxis0->SetValue (false);
    BoxAxis1->SetValue (false);
    BoxAxis2->SetValue (false);
    BoxAxis3->SetValue (false);
    BoxAxis4->SetValue (false);
    BoxAxis5->SetValue (false);
    BoxAxis6->SetValue (false);
}
Exemple #22
0
void RH_RF24::setPreambleLength(uint16_t bytes)
{
    uint8_t config[] = { (uint8_t)bytes, 0x14, 0x00, 0x00, 
			 RH_RF24_PREAMBLE_FIRST_1 | RH_RF24_PREAMBLE_LENGTH_BYTES | RH_RF24_PREAMBLE_STANDARD_1010};
    set_properties(RH_RF24_PROPERTY_PREAMBLE_TX_LENGTH, config, sizeof(config));
}
Exemple #23
0
int cbmc_parse_optionst::doit()
{
  if(cmdline.isset("version"))
  {
    std::cout << CBMC_VERSION << std::endl;
    return 0;
  }
  
  //
  // command line options
  //

  optionst options;
  get_command_line_options(options);
  eval_verbosity();

  //
  // Print a banner
  //
  status() << "CBMC version " CBMC_VERSION " "
           << sizeof(void *)*8 << "-bit "
           << config.this_architecture() << " "
           << config.this_operating_system() << eom;

  //
  // Unwinding of transition systems is done by hw-cbmc.
  //

  if(cmdline.isset("module") ||
     cmdline.isset("gen-interface"))

  {
    error() << "This version of CBMC has no support for "
               " hardware modules. Please use hw-cbmc." << eom;
    return 1;
  }
  
  register_languages();
  
  if(cmdline.isset("test-preprocessor"))
    return test_c_preprocessor(ui_message_handler)?8:0;
  
  if(cmdline.isset("preprocess"))
  {
    preprocessing();
    return 0;
  }

  goto_functionst goto_functions;

  // get solver
  cbmc_solverst cbmc_solvers(options, symbol_table, ui_message_handler);
  cbmc_solvers.set_ui(get_ui());

  std::unique_ptr<cbmc_solverst::solvert> cbmc_solver;
  
  try
  {
    cbmc_solver=cbmc_solvers.get_solver();
  }
  
  catch(const char *error_msg)
  {
    error() << error_msg << eom;
    return 1;
  }

  prop_convt &prop_conv=cbmc_solver->prop_conv();

  bmct bmc(options, symbol_table, ui_message_handler, prop_conv);

  int get_goto_program_ret=
    get_goto_program(options, bmc, goto_functions);

  if(get_goto_program_ret!=-1)
    return get_goto_program_ret;

  label_properties(goto_functions);

  if(cmdline.isset("show-claims") || // will go away
     cmdline.isset("show-properties")) // use this one
  {
    const namespacet ns(symbol_table);
    show_properties(ns, get_ui(), goto_functions);
    return 0;
  }

  if(cmdline.isset("show-reachable-properties")) // may replace --show-properties
  {
    const namespacet ns(symbol_table);
    
    // Entry point will have been set before and function pointers removed
    status() << "Removing Unused Functions" << eom;
    remove_unused_functions(goto_functions, ui_message_handler);
    
    show_properties(ns, get_ui(), goto_functions);
    return 0;
  }

  if(set_properties(goto_functions))
    return 7;

  if(cmdline.isset("danger"))
    return run_danger(options, result(), symbol_table, goto_functions);
  if(cmdline.isset("safety"))
    return run_safety(options, result(), symbol_table, goto_functions);

  // do actual BMC
  return do_bmc(bmc, goto_functions);
}