Changeset 2458a977ecf22a95a75153471ff0733d922d90d2
- Timestamp:
- 29/01/06 18:33:55 (3 years ago)
- git-parent:
- Files:
-
- modules/gui/wxwidgets/dialogs/infopanels.cpp (modified) (4 diffs)
- modules/gui/wxwidgets/dialogs/infopanels.hpp (modified) (1 diff)
- modules/gui/wxwidgets/dialogs/iteminfo.cpp (modified) (5 diffs)
- modules/gui/wxwidgets/dialogs/iteminfo.hpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/gui/wxwidgets/dialogs/infopanels.cpp
ra838001 r2458a97 41 41 wxPanel( _p_parent, -1 ) 42 42 { 43 int flags= wxTE_PROCESS_ENTER; 43 44 /* Initializations */ 44 45 p_intf = _p_intf; … … 50 51 wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); 51 52 52 wxFlexGridSizer *sizer = new wxFlexGridSizer(2,3,20); 53 wxFlexGridSizer *sizer = new wxFlexGridSizer(2,8,20); 54 sizer->AddGrowableCol(1); 55 56 if( !b_modifiable ) 57 flags |= wxTE_READONLY; 58 53 59 /* URI Textbox */ 54 60 wxStaticText *uri_static = 55 61 new wxStaticText( this, -1, wxU(_("URI")) ); 56 sizer->Add( uri_static, 0 , wxALL , 5);62 sizer->Add( uri_static, 0 , wxALL , 0 ); 57 63 58 64 uri_text = new wxTextCtrl( this, -1, 59 wxU(""), wxDefaultPosition, wxSize( 300, -1 ), 60 wxTE_PROCESS_ENTER ); 61 sizer->Add( uri_text, 1 , wxALL , 5 ); 65 wxU(""), wxDefaultPosition, wxSize( 300, -1 ), flags ); 66 sizer->Add( uri_text, 1 , wxALL|wxEXPAND , 0 ); 62 67 63 68 /* Name Textbox */ 64 69 wxStaticText *name_static = 65 70 new wxStaticText( this, -1, wxU(_("Name")) ); 66 sizer->Add( name_static, 0 , wxALL , 5);71 sizer->Add( name_static, 0 , wxALL , 0 ); 67 72 68 73 name_text = new wxTextCtrl( this, -1, 69 wxU(""), wxDefaultPosition, wxSize( 300, -1 ), 70 wxTE_PROCESS_ENTER ); 71 sizer->Add( name_text, 1 , wxALL , 5 ); 74 wxU(""), wxDefaultPosition, wxSize( 300, -1 ), flags ); 75 sizer->Add( name_text, 1 , wxALL|wxEXPAND , 0 ); 72 76 73 77 /* Treeview */ … … 79 83 80 84 sizer->Layout(); 81 panel_sizer->Add( sizer, 0, wxEXPAND | wxALL, 5 );85 panel_sizer->Add( sizer, 0, wxEXPAND | wxALL, 15 ); 82 86 panel_sizer->Add( info_tree, 1, wxEXPAND | wxALL, 5 ); 83 87 panel_sizer->Layout(); … … 112 116 info_tree->Expand( cat ); 113 117 } 118 } 119 120 char* ItemInfoPanel::GetURI( ) 121 { 122 return strdup( uri_text->GetLineText(0).mb_str() ); 123 } 124 125 char* ItemInfoPanel::GetName( ) 126 { 127 return strdup( name_text->GetLineText(0).mb_str() ); 114 128 } 115 129 modules/gui/wxwidgets/dialogs/infopanels.hpp
ra838001 r2458a97 40 40 void Update( input_item_t *); 41 41 void Clear(); 42 43 44 char* GetURI(); 45 char* GetName(); 42 46 43 47 void OnOk(); modules/gui/wxwidgets/dialogs/iteminfo.cpp
r822000a r2458a97 23 23 24 24 #include "dialogs/iteminfo.hpp" 25 #include "dialogs/infopanels.hpp" 25 26 #include <wx/combobox.h> 26 27 #include <wx/statline.h> … … 69 70 70 71 /* Create the standard info panel */ 71 wxPanel *info_panel = InfoPanel( panel);72 72 info_panel = new ItemInfoPanel(p_intf, panel, true ); 73 info_panel->Update( &(p_item->input) ); 73 74 /* Separation */ 74 75 wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK ); … … 87 88 wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); 88 89 wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL ); 89 panel_sizer->Add( info_panel, 0, wxEXPAND | wxALL, 5 );90 panel_sizer->Add( info_panel, 1, wxEXPAND | wxALL, 5 ); 90 91 panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 ); 91 92 panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM | … … 102 103 } 103 104 104 /*****************************************************************************105 * Private methods.106 *****************************************************************************/107 wxPanel *ItemInfoDialog::InfoPanel( wxWindow* parent )108 {109 wxPanel *info_panel = new wxPanel( parent, -1, wxDefaultPosition,110 wxDefaultSize );111 info_panel->SetAutoLayout( TRUE );112 wxBoxSizer *info_sizer = new wxBoxSizer( wxHORIZONTAL );113 114 /* Create a box to surround the controls */115 wxStaticBox *panel_box = new wxStaticBox( info_panel, -1,116 wxU(_("Item Info")) );117 118 wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( panel_box,119 wxVERTICAL );120 121 wxFlexGridSizer *sizer = new wxFlexGridSizer(2,3,20);122 /* URI Textbox */123 wxStaticText *uri_label =124 new wxStaticText( info_panel, -1, wxU(_("URI")) );125 126 uri_text = new wxTextCtrl( info_panel, Uri_Event,127 wxU(p_item->input.psz_uri), wxDefaultPosition, wxSize( 300, -1 ),128 wxTE_PROCESS_ENTER );129 130 sizer->Add( uri_label, 0 , wxALIGN_LEFT |wxALL , 5 );131 sizer->Add( uri_text, 1 , wxALIGN_RIGHT | wxALL , 5 );132 133 /* Name Textbox */134 wxStaticText *name_label =135 new wxStaticText( info_panel, -1, wxU(_("Name")) );136 137 name_text = new wxTextCtrl( info_panel, Uri_Event,138 wxU(p_item->input.psz_name), wxDefaultPosition, wxSize( 300, -1 ),139 wxTE_PROCESS_ENTER );140 141 sizer->Add( name_label, 0 , wxALIGN_LEFT |wxALL , 5 );142 sizer->Add( name_text, 1 , wxALIGN_RIGHT | wxALL , 5 );143 144 /* Treeview */145 info_tree = new wxTreeCtrl( info_panel, -1, wxDefaultPosition,146 wxSize(220,200),147 wxSUNKEN_BORDER |wxTR_HAS_BUTTONS |148 wxTR_HIDE_ROOT | wxTR_HAS_VARIABLE_ROW_HEIGHT );149 150 sizer->Layout();151 box_sizer->Add( sizer, 0, wxEXPAND, 5 );152 box_sizer->Add( info_tree, 0, wxEXPAND, 5 );153 info_sizer->Add( box_sizer, 1, wxBOTTOM, 5 );154 155 info_panel->SetSizer( info_sizer );156 info_sizer->Layout();157 info_sizer->SetSizeHints( info_panel );158 159 UpdateInfo();160 161 return info_panel;162 }163 164 void ItemInfoDialog::UpdateInfo()165 {166 if( !info_root )167 {168 info_root = info_tree->AddRoot( wxU( p_item->input.psz_name) );169 }170 171 /* Rebuild the tree */172 for( int i = 0; i< p_item->input.i_categories ; i++)173 {174 wxTreeItemId cat = info_tree->AppendItem( info_root,175 wxU( p_item->input.pp_categories[i]->psz_name) );176 177 for( int j = 0 ; j < p_item->input.pp_categories[i]->i_infos ; j++ )178 {179 info_tree->AppendItem( cat , (wxString)180 wxU(p_item->input.pp_categories[i]->pp_infos[j]->psz_name) +181 wxT(": ") +182 wxU(p_item->input.pp_categories[i]->pp_infos[j]->psz_value) );183 }184 185 info_tree->Expand( cat );186 }187 }188 105 189 106 /***************************************************************************** … … 193 110 { 194 111 vlc_mutex_lock( &p_item->input.lock ); 195 p_item->input.psz_name = strdup( name_text->GetLineText(0).mb_str());196 p_item->input.psz_uri = strdup( uri_text->GetLineText(0).mb_str());112 p_item->input.psz_name = info_panel->GetName(); 113 p_item->input.psz_uri = info_panel->GetURI(); 197 114 vlc_mutex_unlock( &p_item->input.lock ); 198 115 EndModal( wxID_OK ); modules/gui/wxwidgets/dialogs/iteminfo.hpp
r2cb472d r2458a97 26 26 27 27 #include "wxwidgets.hpp" 28 28 #include "dialogs/infopanels.hpp" 29 29 #include <wx/treectrl.h> 30 30 … … 42 42 43 43 private: 44 wxPanel *InfoPanel( wxWindow* parent );45 44 wxPanel *GroupPanel( wxWindow* parent ); 46 45 … … 59 58 /* Controls for the iteminfo dialog box */ 60 59 wxPanel *info_subpanel; 61 wxPanel *info_panel;60 ItemInfoPanel *info_panel; 62 61 63 62 wxPanel *group_subpanel;
