Changeset 2436


Ignore:
Timestamp:
Jul 19, 2007, 7:05:55 PM (15 years ago)
Author:
charles
Message:

start filling out the main window layout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wx/xmission.cc

    r2435 r2436  
    55#include <wx/config.h>
    66#include <wx/toolbar.h>
     7#include <wx/splitter.h>
     8#include <wx/notebook.h>
    79#include <wx/wx.h>
    810extern "C" {
     
    162164
    163165    /**
    164     ***  Status Bar
     166    ***  Row 1
     167    **/
     168
     169    wxSplitterWindow * hsplit = new wxSplitterWindow( this );
     170
     171    wxPanel * row1 = new wxPanel( hsplit, wxID_ANY );
     172    wxFlexGridSizer * row_sizer = new wxFlexGridSizer( 2, 0, 5 );
     173    row_sizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
     174    row_sizer->SetFlexibleDirection( wxHORIZONTAL );
     175    row1->SetSizer( row_sizer );
     176
     177    /**
     178    ***  Filters
     179    **/
     180
     181    wxListCtrl * filters = new wxListCtrl( row1, wxID_ANY, wxDefaultPosition, wxDefaultSize,
     182                                           wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_NO_HEADER );
     183    filters->InsertColumn( wxLIST_FORMAT_LEFT, _T("YYZ") );
     184    int i = 0;
     185    filters->InsertItem( i++, _T("All") );
     186    filters->InsertItem( i++, _T("Downloading (1)") );
     187    filters->InsertItem( i++, _T("Completed") );
     188    filters->InsertItem( i++, _T("Active (1)") );
     189    filters->InsertItem( i++, _T("Inactive") );
     190    row_sizer->Add( filters, wxSizerFlags().Expand() );
     191
     192    /**
     193    ***  Torrent List
     194    **/
     195
     196    wxListCtrl * torrents = new wxListCtrl( row1, wxID_ANY, wxDefaultPosition, wxDefaultSize,
     197                                            wxLC_REPORT|wxLC_SINGLE_SEL );
     198    torrents->InsertColumn( 0, _T("Name") );
     199    torrents->InsertColumn( 1, _T("#") );
     200    torrents->InsertColumn( 2, _T("Size") );
     201    torrents->InsertColumn( 3, _T("Done") );
     202    torrents->InsertColumn( 4, _T("Status") );
     203    torrents->InsertColumn( 5, _T("Seeds") );
     204    torrents->InsertColumn( 6, _T("Peers") );
     205    row_sizer->Add( torrents, wxSizerFlags().Expand() );
     206    row_sizer->AddGrowableCol( 1, 1 );
     207
     208    i = torrents->InsertItem( 0, _T("Fedora.iso") );
     209    torrents->SetItem( i, 1, _T("*"));
     210    torrents->SetItem( i, 2, _T("4.4 GiB"));
     211    torrents->SetItem( i, 3, _T("50%"));
     212    torrents->SetItem( i, 4, _T("0 (77)"));
     213    torrents->SetItem( i, 5, _T("1 (128)"));
     214
     215
     216    wxNotebook * notebook = new wxNotebook( hsplit, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
     217
     218    wxButton * tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
     219    notebook->AddPage( tmp, _T("General"), false );
     220    tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
     221    notebook->AddPage( tmp, _T("Peers"), false );
     222    tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
     223    notebook->AddPage( tmp, _T("Pieces"), false );
     224    tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
     225    notebook->AddPage( tmp, _T("Files"), false );
     226    tmp = new wxButton( notebook, wxID_ANY, _T("Hello World"));
     227    notebook->AddPage( tmp, _T("Logger"), false );
     228
     229    hsplit->SplitHorizontally( row1, notebook );
     230
     231    /**
     232    ***  Statusbar
    165233    **/
    166234
Note: See TracChangeset for help on using the changeset viewer.