ConfigManager::ConfigManager(wxString apath):lang(LS_INIT) { pseint_dir = apath; version=0; #if defined(_WIN32) || defined(__WIN32__) home_dir = DIR_PLUS_FILE(wxFileName::GetHomeDir(),"pseint"); #else home_dir = DIR_PLUS_FILE(wxFileName::GetHomeDir(),".pseint"); #endif if (!wxFileName::DirExists(home_dir)) wxFileName::Mkdir(home_dir); if (wxFileName::FileExists("config.here")) filename="config.here"; else filename = DIR_PLUS_FILE(home_dir,"config"); LoadDefaults(); Read(); #if defined(__WIN32__) #elif defined(__APPLE__) tty_command="./mac-terminal-wrapper.bin"; #else wxFileName f_path = wxGetCwd(); f_path.MakeAbsolute(); // pseint_command = DIR_PLUS_FILE(f_path.GetFullPath(),"pseint"); // if (pseint_command.Contains(" ")) pseint_command=wxString("\"")<<pseint_command<<"\""; #endif lang.Log(); }
wxString ConfigManager::LoadProfile(wxString pname) { profile=pname; if (lang.Load(DIR_PLUS_FILE(profiles_dir,profile))) { return lang.descripcion.c_str(); } else { return _Z("Esta opcion le permite definir su propia configuracion. Utilice el boton \"Personalizar...\" para definirla."); } }
mxExportPreview::mxExportPreview():wxFrame(main_window,wxID_ANY,_Z("Exportar - Vista previa"),wxDefaultPosition,wxDefaultSize) { pid=0; state=mxEP_NONE; static int tid=0; temp_filename = DIR_PLUS_FILE(config->temp_dir,wxString("temp_ep_")<<tid++); wxBoxSizer *top_sizer = new wxBoxSizer(wxHORIZONTAL); wxSizerFlags sz; sz.Center(); top_sizer->Add( new wxStaticText(this,wxID_ANY,_Z(" Lenguaje: ")),sz ); wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL); wxArrayString langs_list; for (int id = mxID_FILE_EXPORT_LANG_FIRST+1; id < int(mxID_FILE_EXPORT_LANG_LAST); id++) langs_list.Add(utils->GetExportLangName(id).AfterFirst(' ')); combo_lang = new wxComboBox(this,mxID_EXPPREV_LANG,"",wxDefaultPosition,wxDefaultSize,langs_list,wxCB_READONLY); combo_lang->Select(mxID_FILE_EXPORT_LANG_CPP03-mxID_FILE_EXPORT_LANG_FIRST-1); top_sizer->Add(combo_lang,sz); top_sizer->Add(new wxButton(this,mxID_EXPPREV_UPDATE,_Z("Actualizar")),sz); top_sizer->AddStretchSpacer(); top_sizer->Add( new wxBitmapButton(this,mxID_EXPPREV_COPY,wxBitmap(DIR_PLUS_FILE(config->images_path,"tools/copiar.png"),wxBITMAP_TYPE_PNG)), sz); top_sizer->Add( new wxBitmapButton(this,mxID_EXPPREV_SAVE,wxBitmap(DIR_PLUS_FILE(config->images_path,"tools/guardar.png"),wxBITMAP_TYPE_PNG)), sz); main_sizer->Add(top_sizer,wxSizerFlags().Proportion(0).Expand()); code_ctrl = new wxStyledTextCtrl(this,wxID_ANY); code_ctrl->SetMarginType (0, wxSTC_MARGIN_NUMBER); code_ctrl->SetMarginWidth (0, code_ctrl->TextWidth (wxSTC_STYLE_LINENUMBER, " XXXXX")); main_sizer->Add(code_ctrl,wxSizerFlags().Proportion(1).Expand()); SetSizer(main_sizer); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); Show(); UpdatePrev(); }
void mxLibToBuildWindow::SetFName() { if (!constructed) return; bool is_static = type->GetSelection()==1; wxString fname = DIR_PLUS_FILE(path->GetValue(),wxString("lib")<<name->GetValue()); #ifdef __WIN32__ if (is_static) fname<<".a"; else fname<<".dll"; #else if (is_static) fname<<".a"; else fname<<".so"; #endif filename->SetValue(fname); }
BreakPointInfo::BreakPointInfo(project_file_item *_fitem, int _line_number) { fname=DIR_PLUS_FILE(project->path,_fitem->name); #ifdef __WIN32__ for (unsigned int i=0;i<fname.Len();i++) // corregir las barras en windows para que no sean caracter de escape if (fname[i]=='\\') fname[i]='/'; #endif line_number=_line_number; source=nullptr; marker_handle=-1; enabled=true; // only_once=false; action=BPA_STOP_ALWAYS; ignore_count=0; gdb_status=BPS_UNKNOWN; gdb_id=-1; zinjai_id=++last_zinjai_id; _fitem->extras.AddBreakpoint(this); }
mxProfile::mxProfile(wxWindow *parent):wxDialog(parent,wxID_ANY,_Z("Opciones del Lenguaje"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER),old_config(LS_INIT) { text=NULL; // para que no procese el evento de seleccion al crear la lista old_config=config->lang; old_profile=config->profile; wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *search_sizer = new wxBoxSizer(wxHORIZONTAL); search=new wxTextCtrl(this,wxID_FIND,""); search_sizer->Add(new wxStaticText(this,wxID_ANY,_Z("Buscar: ")),wxSizerFlags().Center()); search_sizer->Add(search,wxSizerFlags().Proportion(1).Expand()); sizer->Add(search_sizer,wxSizerFlags().Proportion(0).Expand().Border(wxALL,5)); wxBoxSizer *button_sizer = new wxBoxSizer(wxHORIZONTAL); wxDir dir(config->profiles_dir); if ( dir.IsOpened() ) { wxString filename; wxString spec; bool cont = dir.GetFirst(&filename, spec , wxDIR_FILES); while ( cont ) { perfiles.Add(filename); cont = dir.GetNext(&filename); } } perfiles.Sort(comp_nocase); for(unsigned int i=0;i<perfiles.GetCount();i++) { LangSettings l(LS_INIT); l.Load(DIR_PLUS_FILE(config->profiles_dir,perfiles[i])); descripciones.Add(l.descripcion.c_str()); } list = new wxListCtrl(this,wxID_ANY,wxDefaultPosition,wxSize(200,200),wxLC_REPORT|wxLC_NO_HEADER|wxLC_SINGLE_SEL); list->InsertColumn(0,_Z("Perfil")); wxImageList *iml = new wxImageList(24,24,true); wxBitmap noimage(DIR_PLUS_FILE(DIR_PLUS_FILE(config->profiles_dir,"icons"),"null.png"),wxBITMAP_TYPE_PNG); for(unsigned int i=0;i<perfiles.GetCount();i++) { wxString ficon=DIR_PLUS_FILE(DIR_PLUS_FILE(config->profiles_dir,"icons"),perfiles[i]+".png"); if (wxFileName::FileExists(ficon)) iml->Add(wxBitmap(ficon,wxBITMAP_TYPE_PNG)); else iml->Add(noimage); } iml->Add(wxBitmap(DIR_PLUS_FILE(DIR_PLUS_FILE(config->profiles_dir,"icons"),"personalizado.png"),wxBITMAP_TYPE_PNG)); list->AssignImageList(iml,wxIMAGE_LIST_SMALL); Search(); text = new wxTextCtrl(this,wxID_ANY,_T(""),wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY); LoadProfile(); wxButton *options_button = new mxBitmapButton (this, wxID_ABOUT, bitmaps->buttons.next, _Z("Personalizar...")); wxButton *ok_button = new mxBitmapButton (this, wxID_OK, bitmaps->buttons.ok, _Z("Aceptar")); wxButton *cancel_button = new mxBitmapButton (this, wxID_CANCEL, bitmaps->buttons.cancel, _Z("Cancelar")); button_sizer->Add(options_button,wxSizerFlags().Border(wxALL,5).Proportion(0).Expand()); button_sizer->AddStretchSpacer(1); button_sizer->Add(cancel_button,wxSizerFlags().Border(wxALL,5).Proportion(0).Expand()); button_sizer->Add(ok_button,wxSizerFlags().Border(wxALL,5).Proportion(0).Expand()); sizer->Add(new wxStaticText(this,wxID_ANY,_Z(" Seleccione un perfil para configurar las reglas del lenguaje: ")),wxSizerFlags().Expand().Proportion(0).Border(wxTOP,5)); sizer->Add(list,wxSizerFlags().Expand().Proportion(3).FixedMinSize()); sizer->Add(new wxStaticText(this,wxID_ANY,_Z("")),wxSizerFlags().Expand().Proportion(0)); sizer->Add(new wxStaticText(this,wxID_ANY,_Z(" Descripción del perfil seleccionado:")),wxSizerFlags().Expand().Proportion(0)); sizer->Add(text,wxSizerFlags().Expand().Proportion(1).FixedMinSize()); sizer->Add(new wxStaticText(this,wxID_ANY,""),wxSizerFlags().Expand().Proportion(0)); sizer->Add(button_sizer,wxSizerFlags().Expand().Proportion(0)); ok_button->SetDefault(); SetEscapeId(wxID_CANCEL); SetSizerAndFit(sizer); this->Layout(); // para ajustar el tamaño de la columna de la lista list->SetColumnWidth(0,list->GetSize().GetWidth()-32); search->SetFocus(); ShowModal(); }