|
From: <ma...@us...> - 2004-01-13 23:10:30
|
Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19364/src
Modified Files:
GUISettingsDlg.cpp Images.cpp SBPanel.cpp SearchListCtrl.cpp
SearchListCtrl.h SearchWnd.cpp SearchWnd.h ServerWnd.cpp
defines.h wxInterface.wdr wxInterface_wdr.cpp
wxInterface_wdr.h
Log Message:
* Search page implemented.
* Sidebar width is now correctly updated according to widest content.
Index: GUISettingsDlg.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/GUISettingsDlg.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- GUISettingsDlg.cpp 30 Dec 2003 13:31:48 -0000 1.36
+++ GUISettingsDlg.cpp 13 Jan 2004 23:10:26 -0000 1.37
@@ -397,7 +397,7 @@
_("Change the language of the interface. Requires interface \
restart to take effect") );
#endif
- item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 );
+ item2->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5 );
wxGridSizer *item5 = new wxGridSizer( 2, 0, 0 );
@@ -434,7 +434,7 @@
#ifndef __WXX11__
item10->SetToolTip( _("Change the iconet the interface should use.") );
#endif
- item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 );
+ item8->Add( item10, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5 );
wxGridSizer *item11 = new wxGridSizer( 2, 0, 0 );
@@ -477,7 +477,7 @@
#ifndef __WXX11__
item17->SetToolTip( _("Change the font") );
#endif
- item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5);
+ item15->Add( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5);
wxStaticText *item18 = new wxStaticText(
this, ID_TEXT, _("Font Test :)"), wxDefaultPosition,
@@ -504,7 +504,7 @@
_("Set which page will be displayed on program startup")
);
#endif
- item19->Add( item21, 0, wxGROW|border_style, 5 );
+ item19->Add( item21, 0, wxGROW|BORDERSTYLE, 5 );
wxCheckBox *item22 = new wxCheckBox(
this, ID_REMEMBER_LAST, _("Remember last"), wxDefaultPosition,
@@ -515,7 +515,7 @@
_("Automatically remember which page was \
open between sessions"));
#endif
- item19->Add(item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5);
+ item19->Add(item22, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5);
item14->Add( item19, 0, wxLEFT|wxRIGHT, 5 );
@@ -535,7 +535,7 @@
Default: On")
);
#endif
- item23->Add( item24, 0, wxGROW|wxLEFT|border_style, 5 );
+ item23->Add( item24, 0, wxGROW|wxLEFT|BORDERSTYLE, 5 );
wxCheckBox *item25 = new wxCheckBox(
this, ID_PROMPTEXIT, _("Prompt on exit"), wxDefaultPosition,
@@ -549,7 +549,7 @@
#endif
item23->Add(
item25, 0, wxGROW|wxALIGN_CENTER_VERTICAL
- |wxLEFT|border_style, 5
+ |wxLEFT|BORDERSTYLE, 5
);
wxBoxSizer *item26 = new wxBoxSizer( wxHORIZONTAL );
@@ -564,7 +564,7 @@
#endif
item26->Add(
item27, 0, wxGROW|wxALIGN_CENTER_VERTICAL|
- wxLEFT|border_style, 5
+ wxLEFT|BORDERSTYLE, 5
);
wxString strs28[] = {
@@ -582,7 +582,7 @@
#endif
item26->Add(
item28, 0, wxALIGN_RIGHT|
- wxALIGN_CENTER_VERTICAL|border_style, 5
+ wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5
);
item23->Add( item26, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -599,7 +599,7 @@
#endif
item23->Add(
item29, 0, wxGROW|wxALIGN_CENTER_VERTICAL|
- wxLEFT|border_style, 5
+ wxLEFT|BORDERSTYLE, 5
);
item0->Add( item23, 0, wxGROW, 5 );
Index: Images.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- Images.cpp 31 Dec 2003 10:52:55 -0000 1.55
+++ Images.cpp 13 Jan 2004 23:10:26 -0000 1.56
@@ -83,7 +83,7 @@
names.Add(wxT("btn_preferences")); names.Add(wxT("splashscreen"));
names.Add(wxT("leftarrow")); names.Add(wxT("rightarrow"));
names.Add(wxT("options")); names.Add(wxT("help"));
- names.Add(wxT("quit"));
+ names.Add(wxT("quit")); names.Add(wxT("filter"));
tool_img_width = 32;
Index: SBPanel.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/SBPanel.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- SBPanel.cpp 31 Dec 2003 10:24:26 -0000 1.19
+++ SBPanel.cpp 13 Jan 2004 23:10:26 -0000 1.20
@@ -113,7 +113,10 @@
mainsizer->Show(content);
shown = true;
}
+ GetParent()->Fit();
GetParent()->Layout();
+ GetParent()->GetParent()->Layout();
+ GetParent()->GetParent()->Update();
}
/***************************************************************** SetContent */
Index: SearchListCtrl.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchListCtrl.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- SearchListCtrl.cpp 20 Nov 2003 01:27:26 -0000 1.8
+++ SearchListCtrl.cpp 13 Jan 2004 23:10:26 -0000 1.9
@@ -39,7 +39,7 @@
* column layout.
*/
CSearchListCtrl::CSearchListCtrl(
- wxWindow*& parent,int id,const wxPoint& pos,wxSize siz,int flags
+ wxWindow* parent,int id,const wxPoint& pos,wxSize siz,int flags
)
: CMListCtrl(parent,id,pos,siz,flags) {
Index: SearchListCtrl.h
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchListCtrl.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SearchListCtrl.h 24 Nov 2003 16:06:32 -0000 1.6
+++ SearchListCtrl.h 13 Jan 2004 23:10:26 -0000 1.7
@@ -36,7 +36,7 @@
class CSearchListCtrl: public CMListCtrl {
public:
- CSearchListCtrl(wxWindow*& parent,int id,const wxPoint& pos,
+ CSearchListCtrl(wxWindow* parent,int id,const wxPoint& pos,
wxSize siz,int flags);
private:
Index: SearchWnd.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- SearchWnd.cpp 29 Dec 2003 09:25:25 -0000 1.17
+++ SearchWnd.cpp 13 Jan 2004 23:10:26 -0000 1.18
@@ -31,42 +31,617 @@
#include "SearchWnd.h"
#include "MainDlg.h"
-/*
- * CSearchWnd class.
- */
-
+/**************************************************************** EVENT TABLE */
+/* Search Page event handling table. Not very interesting, sidebar toggling */
+/* event and checkboxes event handling is defined. Should get more */
+/* interesting in the future. */
+/******************************************************************************/
BEGIN_EVENT_TABLE(CSearchWnd,wxPanel)
- EVT_TEXT_ENTER(ID_SEARCHSTRING, CSearchWnd::StartNewSearch)
+ EVT_BUTTON(ID_BTN_TOGGLE_SEARCH_SIDEBAR, CSearchWnd::ToggleSidebar)
+ EVT_CHECKBOX(-1, CSearchWnd::HandleCheckEvents)
END_EVENT_TABLE()
-/*
- * Constructor for search window.
- */
+/***************************************************************** CSearchWnd */
+/* Contructor for Search Page. Pretty much generic, call controls creation */
+/* method, and hide ourselves. */
+/******************************************************************************/
CSearchWnd::CSearchWnd(
wxWindow *parent, wxWindowID id, const wxPoint &position,
const wxSize& size, long style )
: wxPanel( parent, id, position, size, style ) {
- SearchWnd( this, TRUE );
-
- GetSearchResultsImage()->SetBitmap(img->GetImage(wxT("searchresults")));
- GetSearchResultsImage()->SetName(wxT("searchresults"));
+bool sb_isshown; /* Wether sidebar is shown or not */
- Hide();
+ CreateControls();
- GetSearchType()->SetSelection(0);
- GetSearchMethod()->SetSelection(0);
+ m_config->Read(wxT("/SearchWnd/SideBar"), &sb_isshown);
+
+ if (!sb_isshown) {
+ wxCommandEvent nullevent;
+ ToggleSidebar(nullevent);
+ }
+
+ Hide();
}
-/*
- * Destructor for search window. All shutdown functions go here.
- */
+/**************************************************************** ~CSearchWnd */
+/* The destroyer of Search Page. Just save the settings before leaving. */
+/******************************************************************************/
CSearchWnd::~CSearchWnd() {
+ SaveSettings();
}
-/*
- * Starts new search: Reads the search string from interface and sends search
- * string to core.
- */
-void CSearchWnd::StartNewSearch(wxCommandEvent &event) {
- m_searchstring = GetSearchString()->GetValue();
+/************************************************************* CreateControls */
+/* There we go - start creating the page layout. Here we have: */
+/* mainsizer - class member variable, containing all controls of this page */
+/* sidebar - the sidebar containing various searching-related options/flags */
+/* Sidebar panels have their own controls-creation methods. Most of this page */
+/* is filled with CSearchListCtrl, which will contain the search results. */
+/******************************************************************************/
+void CSearchWnd::CreateControls() {
+ mainsizer = new wxFlexGridSizer(3);
+ mainsizer->AddGrowableCol(2);
+ mainsizer->AddGrowableRow(0);
+
+ /* Sidebar ... */
+ sidebar = new wxPanel(
+ this, -1, wxDefaultPosition, wxDefaultSize,
+ wxNO_FULL_REPAINT_ON_RESIZE|wxGROW, wxT("SearchWnd SideBar")
+ );
+ wxFlexGridSizer *sbmain = new wxFlexGridSizer(1, 0, 0);
+ sbmain->AddGrowableCol(0);
+
+ sidebar->SetSizer(sbmain);
+ sidebar->SetAutoLayout(true);
+ sbmain->Fit(sidebar);
+ sbmain->SetSizeHints(sidebar);
+
+#ifdef __WXMSW__
+ mainsizer->Add(sidebar, 0, wxGROW|wxADJUST_MINSIZE, 5);
+#else
+ mainsizer->Add(sidebar, 0, wxGROW|wxADJUST_MINSIZE|wxTOP, 5);
+#endif
+
+ /* Sidebar panels ... */
+ CSBPanel *filters = new CSBPanel(
+ sidebar, -1, _("Results Filtering"),
+ wxT("SideBar_SearchFilter"), wxT("filter")
+ );
+ filters->SetContent(CreateFiltersPanel(filters));
+ sbmain->Add(filters, 0, wxGROW|wxALL|wxADJUST_MINSIZE);
+
+ CSBPanel *methods = new CSBPanel(
+ sidebar, -1, _("Search Method"),
+ wxT("SideBar_SearchMethod"), wxT("searchresults")
+ );
+ methods->SetContent(CreateMethodsPanel(methods));
+ sbmain->Add(methods, 0, wxGROW|wxALL|wxADJUST_MINSIZE);
+
+ /* Toggler ... */
+ wxButton *toggler = new wxButton(
+ this, ID_BTN_TOGGLE_SEARCH_SIDEBAR, wxT("<"),
+ wxDefaultPosition, wxSize(12, 100), wxNO_BORDER
+ );
+ toggler->SetFont(wxFont(14, wxNORMAL, wxNORMAL, wxBOLD));
+ mainsizer->Add(toggler, 0, wxALIGN_CENTER, 5 );
+
+#ifndef __WXX11__
+ toggler->SetToolTip(_("Toggle sidebar on/off."));
+#endif
+
+ wxFlexGridSizer *s_right = new wxFlexGridSizer(1);
+ s_right->AddGrowableCol(0);
+ s_right->AddGrowableRow(1);
+
+ wxFlexGridSizer *s_top = new wxFlexGridSizer(2);
+ s_top->AddGrowableCol(0);
+
+ wxTextCtrl *t_search = new wxTextCtrl(this, ID_SEARCH_STRING);
+ s_top->Add(t_search, 0, wxGROW|wxEXPAND);
+ wxButton *b_search = new wxButton(
+ this, ID_SEARCH, _("Search"), wxDefaultPosition,
+ wxDefaultSize, wxNO_BORDER
+ );
+ s_top->Add(b_search);
+
+#ifndef __WXX11__
+ t_search->SetToolTip(
+ _("Enter search string here. Regular expressions (AND/OR etc)"
+ "are supported. Alternativly, enter ed2k://file link to"
+ "directly start a download (multiple links supported).")
+ );
+#endif
+ s_right->Add(s_top, 0, wxGROW|wxEXPAND);
+
+ list = new CSearchListCtrl(
+ this, -1, wxDefaultPosition, wxDefaultSize,
+ wxLC_REPORT|wxSUNKEN_BORDER
+ );
+ s_right->Add(list, 0, wxGROW|wxEXPAND);
+
+ mainsizer->Add(s_right, 0, wxGROW|wxEXPAND|wxTOP|wxRIGHT|wxBOTTOM, 5);
+
+ SetSizer(mainsizer);
+ SetAutoLayout(true);
+ mainsizer->Fit(this);
+ mainsizer->SetSizeHints(this);
+}
+
+/********************************************************* CreateFiltersPanel */
+/* This method creates the search result filtering panel content. The */
+/* interesting part here is the top part checkboxes - they are only visible */
+/* if `All types` box is unchecked. */
+/* @parent Parent window to be created controls in. */
+/******************************************************************************/
+wxSizer* CSearchWnd::CreateFiltersPanel(wxWindow *parent) {
+bool tmp; /* Temporary storage for boolean values read from config */
+int tmp2; /* Temporary storage for integer values read from config */
+ m_config->SetPath(wxT("/SearchWnd"));
+
+ wxFlexGridSizer *s_main = new wxFlexGridSizer(1);
+
+ /* Top part - 6 checkboxes for type filtering */
+ wxFlexGridSizer *s_flex1 = new wxFlexGridSizer(2);
+ s_main->Add(s_flex1, 0, wxGROW|wxEXPAND);
+ s_filters = s_flex1; /* Store it there also for easier access */
+
+ wxCheckBox *c_all = new wxCheckBox(parent, ID_FLT_ALL, _("All types"));
+ wxFont fnt= c_all->GetFont();
+ fnt.SetWeight(wxBOLD);
+ c_all->SetFont(fnt);
+ s_flex1->Add(c_all, 0, BORDERSTYLE|wxALIGN_LEFT|wxADJUST_MINSIZE, 5);
+ m_config->Read(wxT("Filter_ShowAll"), &tmp, true);
+ c_all->SetValue(tmp);
+
+ if (!c_all->GetValue()) {
+ CreateFilterChecks(parent, s_flex1);
+ }
+
+#ifndef __WXX11__
+ c_all->SetToolTip(
+ _("If checked, no search results filtering will accour.")
+ );
+#endif
+
+ /* Bottom part - 8+8 check/txt boxes for other kinds of filtering */
+ wxFlexGridSizer *s_flex2 = new wxFlexGridSizer(2);
+ s_main->Add(s_flex2, 0, wxGROW|wxEXPAND);
+
+ wxCheckBox *c_size_l = new wxCheckBox(
+ parent, ID_CHK_FLT_SIZE_L, _("Size larger than")
+ );
+ s_flex2->Add(c_size_l, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxTextCtrl *t_size_l = new wxTextCtrl(
+ parent, ID_TXT_FLT_SIZE_L, wxEmptyString,
+ wxDefaultPosition, wxSize(40, -1)
+ );
+ s_flex2->Add(t_size_l, 0, wxALIGN_LEFT|wxEXPAND);
+
+ wxCheckBox *c_size_s = new wxCheckBox(
+ parent, ID_CHK_FLT_SIZE_S, _("Size smaller than")
+ );
+ s_flex2->Add(c_size_s, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxTextCtrl *t_size_s = new wxTextCtrl(
+ parent, ID_TXT_FLT_SIZE_S, wxEmptyString,
+ wxDefaultPosition, wxSize(40, -1)
+ );
+ s_flex2->Add(t_size_s, 0, wxALIGN_LEFT|wxEXPAND);
+
+ wxCheckBox *c_src_m = new wxCheckBox(
+ parent, ID_CHK_FLT_SRC_M, _("More than ... sources")
+ );
+ s_flex2->Add(c_src_m, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxTextCtrl *t_src_m = new wxTextCtrl(
+ parent, ID_TXT_FLT_SRC_M, wxEmptyString,
+ wxDefaultPosition, wxSize(40, -1)
+ );
+ s_flex2->Add(t_src_m, 0, wxALIGN_LEFT|wxEXPAND);
+
+ wxCheckBox *c_limit = new wxCheckBox(
+ parent, ID_CHK_FLT_LIMIT, _("Limit number of results")
+ );
+ s_flex2->Add(c_limit, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxTextCtrl *t_limit = new wxTextCtrl(
+ parent, ID_TXT_FLT_LIMIT, wxEmptyString,
+ wxDefaultPosition, wxSize(40, -1)
+ );
+ s_flex2->Add(t_limit, 0, wxALIGN_LEFT|wxEXPAND);
+
+#ifndef __WXX11__
+ c_size_l->SetToolTip(
+ _("Check to show only files with size larger than ...")
+ );
+ t_size_l->SetToolTip(
+ _("The size (in MB's) of the smallest file to be shown.")
+ );
+ c_size_s->SetToolTip(
+ _("Check to show only files with size smaller than ...")
+ );
+ t_size_s->SetToolTip(
+ _("The size (in MB's) of the largest file to be shown.")
+ );
+ c_src_m->SetToolTip(
+ _("Check to show only files with at least ... sources.")
+ );
+ t_src_m->SetToolTip(
+ _("Minimal amount of sources a file needs to be shown.")
+ );
+ c_limit->SetToolTip(
+ _("If checked, only ... first search results will be shown.")
+ );
+ t_limit->SetToolTip(
+ _("Enter the maximum number of search results to be displayed.")
+ );
+#endif
+
+ m_config->Read(wxT("Filter_Size_L_Check"), &tmp, false);
+ c_size_l->SetValue(tmp);
+ m_config->Read(wxT("Filter_Size_L_Value"), &tmp2, 0);
+ *t_size_l << tmp2;
+ t_size_l->Enable(tmp);
+
+ m_config->Read(wxT("Filter_Size_S_Check"), &tmp, false);
+ c_size_s->SetValue(tmp);
+ m_config->Read(wxT("Filter_Size_S_Value"), &tmp2, 0);
+ *t_size_s << tmp2;
+ t_size_s->Enable(tmp);
+
+ m_config->Read(wxT("Filter_Src_M_Check"), &tmp, false);
+ c_src_m->SetValue(tmp);
+ m_config->Read(wxT("Filter_Src_M_Value"), &tmp2, 0);
+ *t_src_m << tmp2;
+ t_src_m->Enable(tmp);
+
+ m_config->Read(wxT("Filter_Limit_Check"), &tmp, true);
+ c_limit->SetValue(tmp);
+ m_config->Read(wxT("Filter_Limit_Value"), &tmp2, 300);
+ *t_limit << tmp2;
+ t_limit->Enable(tmp);
+
+ return s_main;
+}
+
+/********************************************************* CreateMethodsPanel */
+/* Creation of the search methology panel. Only controls there are 4 (more to */
+/* come!) radiobuttons. */
+/* @parent Parent window to be created controls in. */
+/******************************************************************************/
+wxSizer* CSearchWnd::CreateMethodsPanel(wxWindow *parent) {
+int tmp; /* Temporary storage for integer type values read from config */
+ wxFlexGridSizer *s_main = new wxFlexGridSizer(1);
+ s_main->AddGrowableCol(0);
+
+ wxRadioButton *r_cursrv = new wxRadioButton(
+ parent, ID_RAD_MET_CURSRV, _("Current Server")
+ );
+ s_main->Add(r_cursrv, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxRadioButton *r_allsrv = new wxRadioButton(
+ parent, ID_RAD_MET_ALLSRV, _("All Servers")
+ );
+ s_main->Add(r_allsrv, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxRadioButton *r_jigle = new wxRadioButton(
+ parent, ID_RAD_MET_JIGLE, _("Jigle Database")
+ );
+ s_main->Add(r_jigle, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxRadioButton *r_fdnk = new wxRadioButton(
+ parent, ID_RAD_MET_FDNK, _("FileDonkey Database")
+ );
+ s_main->Add(r_fdnk, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+
+#ifndef __WXX11__
+ r_cursrv->SetToolTip(_("Search only the currently connected server."));
+ r_allsrv->SetToolTip(_("Search all servers in server list."));
+ r_jigle->SetToolTip(_("Search the Jigle web database."));
+ r_fdnk->SetToolTip(_("Search the FileDonkey web database."));
+#endif
+
+ m_config->Read(wxT("/SearchWnd/Method"), &tmp, 0);
+ switch (tmp) {
+ case 0:
+ r_cursrv->SetValue(true);
+ break;
+ case 1:
+ r_allsrv->SetValue(true);
+ break;
+ case 2:
+ r_jigle->SetValue(true);
+ break;
+ case 3:
+ r_fdnk->SetValue(true);
+ break;
+ default:
+ r_cursrv->SetValue(true);
+ break;
+ }
+ return s_main;
+}
+
+/************************************************************** ToggleSidebar */
+/* Sidebar toggler. #ifdefed to be only used when we have patched wxSizer. */
+/* If its shown, remove it from mainsizer and hide it, otherwise, prepend it */
+/* to mainsizer and show it. Refresh() to avoid wierd visual leftovers. */
+/******************************************************************************/
+void CSearchWnd::ToggleSidebar(const wxCommandEvent &event) {
+#ifdef __HAVE_REMOVE_GROWABLE_COL__
+ if (sidebar->IsShown()) {
+ mainsizer->Remove(sidebar);
+ mainsizer->RemoveGrowableCol(2);
+ mainsizer->AddGrowableCol(1);
+ sidebar->Hide();
+ GetBtnToggleSidebar()->SetLabel(wxT(">"));
+ } else {
+#ifdef __WXMSW__
+ mainsizer->Prepend(
+ sidebar, 0, wxGROW|wxBOTTOM|wxADJUST_MINSIZE, 5
+ );
+#else
+ mainsizer->Prepend(
+ sidebar, 0, wxGROW|wxTOP|wxBOTTOM|wxADJUST_MINSIZE, 5
+ );
+#endif
+ mainsizer->RemoveGrowableCol(1);
+ mainsizer->AddGrowableCol(2);
+ sidebar->Show();
+ GetBtnToggleSidebar()->SetLabel(wxT("<"));
+ }
+ Layout();
+ Refresh();
+#endif
+}
+
+/********************************************************** HandleCheckEvents */
+/* Here we hadle all check events. Its easier to handle them all in same */
+/* place, rather than having separate method for each of them (hei, they'r */
+/* not THAT important :P). Anyway, nothing of interest to see here - move on. */
+/******************************************************************************/
+void CSearchWnd::HandleCheckEvents(const wxCommandEvent &event) {
+ switch (event.GetId()) {
+ case ID_FLT_ALL:
+ CreateFilterChecks(
+ GetCheckFilterAll()->GetParent(),
+ s_filters,
+ !GetCheckFilterAll()->GetValue()
+ );
+ break;
+ case ID_CHK_FLT_SIZE_L:
+ GetTextFilterSizeL()->Enable(
+ GetCheckFilterSizeL()->GetValue()
+ );
+ break;
+ case ID_CHK_FLT_SIZE_S:
+ GetTextFilterSizeS()->Enable(
+ GetCheckFilterSizeS()->GetValue()
+ );
+ break;
+ case ID_CHK_FLT_SRC_M:
+ GetTextFilterSrcM()->Enable(
+ GetCheckFilterSrcM()->GetValue()
+ );
+ break;
+ case ID_CHK_FLT_LIMIT:
+ GetTextFilterLimit()->Enable(
+ GetCheckFilterLimit()->GetValue()
+ );
+ break;
+ default:
+ break;
+ }
+}
+
+/********************************************************* CreateFiltersPanel */
+/* Creates filtering checkboxes in @parent window to sizer @s_flex1. If @add */
+/* is true, the boxes are added, if false, they are removed/deleted. And */
+/* don't forget to save the checkbox states if they are removed. */
+/* @parent Parent window to be created controls in */
+/* @s_flex1 Sizer to append the checkboxes into */
+/* @add Wether to add or remove the checks - default: true (add) */
+/******************************************************************************/
+void CSearchWnd::CreateFilterChecks(
+ wxWindow *parent, wxFlexGridSizer *s_flex1, bool add
+) {
+bool tmp; /* Temporary storage for boolean type values read from config */
+ if (add) {
+ wxCheckBox *c_audio = new wxCheckBox(
+ parent, ID_FLT_AUD, _("Audio")
+ );
+ s_flex1->Add(c_audio, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_video = new wxCheckBox(
+ parent, ID_FLT_VID, _("Video")
+ );
+ s_flex1->Add(c_video, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_archives = new wxCheckBox(
+ parent, ID_FLT_ARC, _("Archives")
+ );
+ s_flex1->Add(c_archives, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_cdimages = new wxCheckBox(
+ parent, ID_FLT_CDI, _("CD Images")
+ );
+ s_flex1->Add(c_cdimages, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_pictures = new wxCheckBox(
+ parent, ID_FLT_PIC, _("Pictures")
+ );
+ s_flex1->Add(c_pictures, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_apps = new wxCheckBox(
+ parent, ID_FLT_APP, _("Applications")
+ );
+ s_flex1->Add(c_apps, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+ wxCheckBox *c_doc = new wxCheckBox(
+ parent, ID_FLT_DOC, _("Documents")
+ );
+ s_flex1->Add(c_doc, 0, BORDERSTYLE|wxALIGN_LEFT, 5);
+
+#ifndef __WXX11__
+ c_audio->SetToolTip(
+ _("UNcheck to filter OUT files with mp3/ogg/wav/ape "
+ "etc extensions.")
+ );
+ c_video->SetToolTip(
+ _("UNcheck to filter OUT files with avi/mpg/ogm "
+ "etc extensions.")
+ );
+ c_archives->SetToolTip(
+ _("UNcheck to filter OUT files with zip/rar/ace "
+ "etc extensions.")
+ );
+ c_cdimages->SetToolTip(
+ _("UNcheck to filter OUT files with bin/ccd/iso "
+ "etc extensions.")
+ );
+ c_pictures->SetToolTip(
+ _("UNcheck to filter OUT files with jpg/png/bmp "
+ "etc extensions.")
+ );
+ c_apps->SetToolTip(
+ _("UNcheck to filter OUT files with exe/com/bat "
+ "etc extensions.")
+ );
+ c_doc->SetToolTip(
+ _("UNcheck to filter OUT files with doc/pdf/txt "
+ "etc extensions.")
+ );
+#endif
+
+ /* Set on/off/values according to config */
+ m_config->SetPath(wxT("/SearchWnd"));
+ m_config->Read(wxT("Filter_Audio"), &tmp, true);
+ c_audio->SetValue(tmp);
+ m_config->Read(wxT("Filter_Video"), &tmp, true);
+ c_video->SetValue(tmp);
+ m_config->Read(wxT("Filter_Archives"), &tmp, true);
+ c_archives->SetValue(tmp);
+ m_config->Read(wxT("Filter_CDImages"), &tmp, true);
+ c_cdimages->SetValue(tmp);
+ m_config->Read(wxT("Filter_Pictures"), &tmp, true);
+ c_pictures->SetValue(tmp);
+ m_config->Read(wxT("Filter_Applications"), &tmp, true);
+ c_apps->SetValue(tmp);
+ m_config->Read(wxT("Filter_Documents"), &tmp, true);
+ c_doc->SetValue(tmp);
+ } else {
+ /* Don't forget states! */
+ m_config->Write(
+ wxT("Filter_Audio"),
+ GetCheckFilterAudio()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Video"),
+ GetCheckFilterVideo()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Archives"),
+ GetCheckFilterArchives()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Applications"),
+ GetCheckFilterApplications()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_CDIimages"),
+ GetCheckFilterCDImages()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Pictures"),
+ GetCheckFilterPictures()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Documents"),
+ GetCheckFilterDocuments()->GetValue()
+ );
+
+ s_flex1->Remove(GetCheckFilterAudio());
+ delete GetCheckFilterAudio();
+ s_flex1->Remove(GetCheckFilterVideo());
+ delete GetCheckFilterVideo();
+ s_flex1->Remove(GetCheckFilterArchives());
+ delete GetCheckFilterArchives();
+ s_flex1->Remove(GetCheckFilterCDImages());
+ delete GetCheckFilterCDImages();
+ s_flex1->Remove(GetCheckFilterPictures());
+ delete GetCheckFilterPictures();
+ s_flex1->Remove(GetCheckFilterApplications());
+ delete GetCheckFilterApplications();
+ s_flex1->Remove(GetCheckFilterDocuments());
+ delete GetCheckFilterDocuments();
+ }
+ parent->Layout(); /* SBPanel ... */
+ parent->Fit();
+ parent->GetParent()->Layout(); /* Sidebar ... */
+ Layout();
+}
+
+/*************************************************************** SaveSettings */
+/* Save various settings relevant to this page. Don't touch filter checkboxes */
+/* if ShowAll isn't checked, since they don't exist then -> would crash us. */
+/******************************************************************************/
+void CSearchWnd::SaveSettings() {
+long tmp; /* Temporary storage for long type values for writing to config */
+ m_config->SetPath(wxT("/SearchWnd"));
+ m_config->Write(wxT("SideBar"), sidebar->IsShown());
+
+ m_config->Write(wxT("Filter_ShowAll"), GetCheckFilterAll()->GetValue());
+ if (!GetCheckFilterAll()->GetValue()) {
+ m_config->Write(
+ wxT("Filter_Audio"),
+ GetCheckFilterAudio()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Video"),
+ GetCheckFilterVideo()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Archives"),
+ GetCheckFilterArchives()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Applications"),
+ GetCheckFilterApplications()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_CDIimages"),
+ GetCheckFilterCDImages()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Pictures"),
+ GetCheckFilterPictures()->GetValue()
+ );
+ m_config->Write(
+ wxT("Filter_Documents"),
+ GetCheckFilterDocuments()->GetValue()
+ );
+ }
+
+ m_config->Write(
+ wxT("Filter_Size_L_Check"), GetCheckFilterSizeL()->GetValue()
+ );
+ GetTextFilterSizeL()->GetValue().ToLong(&tmp);
+ m_config->Write(wxT("Filter_Size_L_Value"), tmp);
+
+ m_config->Write(
+ wxT("Filter_Size_S_Check"), GetCheckFilterSizeS()->GetValue()
+ );
+ GetTextFilterSizeS()->GetValue().ToLong(&tmp);
+ m_config->Write(wxT("Filter_Size_S_Value"), tmp);
+
+ m_config->Write(
+ wxT("Filter_Src_M_Check"), GetCheckFilterSrcM()->GetValue()
+ );
+ GetTextFilterSrcM()->GetValue().ToLong(&tmp);
+ m_config->Write(wxT("Filter_Src_M_Value"), tmp);
+
+ m_config->Write(
+ wxT("Filter_Limit"), GetCheckFilterLimit()->GetValue()
+ );
+ GetTextFilterLimit()->GetValue().ToLong(&tmp);
+ m_config->Write(wxT("Filter_Limit"), tmp);
+
+ if (GetRadioMethodCurSrv()->GetValue()) {
+ m_config->Write(wxT("Method"), 0);
+ } else if (GetRadioMethodAllSrv()->GetValue()) {
+ m_config->Write(wxT("Method"), 1);
+ } else if (GetRadioMethodJigle()->GetValue()) {
+ m_config->Write(wxT("Method"), 2);
+ } else if (GetRadioMethodFDnk()->GetValue()) {
+ m_config->Write(wxT("Method"), 3);
+ } else {
+ m_config->Write(wxT("Method"), 0);
+ }
}
Index: SearchWnd.h
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/SearchWnd.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- SearchWnd.h 20 Nov 2003 01:27:26 -0000 1.9
+++ SearchWnd.h 13 Jan 2004 23:10:26 -0000 1.10
@@ -30,56 +30,113 @@
/* Private headers */
#include "wxInterface_wdr.h"
+#include "SearchListCtrl.h"
#include "defines.h"
-/*
- * CSearchWnd class.
- */
-
+/************************* CSearchWnd class ***********************************/
+/* This is the Search Page of the interface. Being a fairly standard page, it */
+/* has a sidebar with various options, a textbox+button for search string or */
+/* ed2k link, and da search list ofcourse. The list itself is done in */
+/* CSearcListCtrl class tho. */
+/******************************************************************************/
class CSearchWnd: public wxPanel
{
public:
- CSearchWnd(
+ CSearchWnd( /* Constructor */
wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER |
wxNO_FULL_REPAINT_ON_RESIZE
);
- virtual ~CSearchWnd();
-
+ ~CSearchWnd(); /* Destructor */
+
private:
DECLARE_EVENT_TABLE()
- void StartNewSearch(wxCommandEvent &event);
-
- /* Getters for dialog controls */
- wxTextCtrl* GetExtension() {
- return (wxTextCtrl*) FindWindow( ID_EXTENSION );
+
+ /* Private methods */
+ void CreateControls(); /* Main controls creation method */
+ wxSizer* CreateFiltersPanel(wxWindow *parent);
+ void CreateFilterChecks( /* Filter SBPanel checkboxes creation */
+ wxWindow *parent, wxFlexGridSizer *s_flex1, bool add = true
+ );
+ wxSizer* CreateMethodsPanel(wxWindow *parent);/* Search methods panel */
+ void SaveSettings(); /* Save various settings, like check states etc */
+
+ /* Event handlers */
+ void ToggleSidebar(const wxCommandEvent &event);/* Toggles sidebar :) */
+ void HandleCheckEvents( /* Handles checkbox on/off switching events */
+ const wxCommandEvent &event
+ );
+
+ /* Getters */
+ wxButton* GetBtnToggleSidebar() {
+ return (wxButton*)FindWindow(ID_BTN_TOGGLE_SEARCH_SIDEBAR);
}
- wxTextCtrl* GetMaxsize() {
- return (wxTextCtrl*) FindWindow( ID_MAXSIZE );
+ wxCheckBox* GetCheckFilterAll() {
+ return (wxCheckBox*)FindWindow(ID_FLT_ALL);
}
- wxTextCtrl* GetAvail() {
- return (wxTextCtrl*) FindWindow( ID_AVAIL );
+ wxCheckBox* GetCheckFilterVideo() {
+ return (wxCheckBox*)FindWindow(ID_FLT_VID);
}
- wxTextCtrl* GetMinsize() {
- return (wxTextCtrl*) FindWindow( ID_MINSIZE );
+ wxCheckBox* GetCheckFilterAudio() {
+ return (wxCheckBox*)FindWindow(ID_FLT_AUD);
}
- wxChoice* GetSearchMethod() {
- return (wxChoice*) FindWindow( ID_SEARCHMETHOD );
+ wxCheckBox* GetCheckFilterArchives() {
+ return (wxCheckBox*)FindWindow(ID_FLT_ARC);
}
- wxChoice* GetSearchType() {
- return (wxChoice*) FindWindow( ID_SEARCHTYPE );
+ wxCheckBox* GetCheckFilterCDImages() {
+ return (wxCheckBox*)FindWindow(ID_FLT_CDI);
}
- wxTextCtrl* GetSearchString() {
- return (wxTextCtrl*) FindWindow( ID_SEARCHSTRING );
+ wxCheckBox* GetCheckFilterPictures() {
+ return (wxCheckBox*)FindWindow(ID_FLT_PIC);
}
- wxStaticBitmap* GetSearchResultsImage() {
- return (wxStaticBitmap*) FindWindow( ID_SEARCH_RESULTS_IMAGE );
+ wxCheckBox* GetCheckFilterApplications() {
+ return (wxCheckBox*)FindWindow(ID_FLT_APP);
}
-
- wxString m_searchstring;
- wxImageList *m_imagelist;
+ wxCheckBox* GetCheckFilterDocuments() {
+ return (wxCheckBox*)FindWindow(ID_FLT_DOC);
+ }
+ wxCheckBox* GetCheckFilterSizeL() {
+ return (wxCheckBox*)FindWindow(ID_CHK_FLT_SIZE_L);
+ }
+ wxTextCtrl* GetTextFilterSizeL() {
+ return (wxTextCtrl*)FindWindow(ID_TXT_FLT_SIZE_L);
+ }
+ wxCheckBox* GetCheckFilterSizeS() {
+ return (wxCheckBox*)FindWindow(ID_CHK_FLT_SIZE_S);
+ }
+ wxTextCtrl* GetTextFilterSizeS() {
+ return (wxTextCtrl*)FindWindow(ID_TXT_FLT_SIZE_S);
+ }
+ wxCheckBox* GetCheckFilterSrcM() {
+ return (wxCheckBox*)FindWindow(ID_CHK_FLT_SRC_M);
+ }
+ wxTextCtrl* GetTextFilterSrcM() {
+ return (wxTextCtrl*)FindWindow(ID_TXT_FLT_SRC_M);
+ }
+ wxCheckBox* GetCheckFilterLimit() {
+ return (wxCheckBox*)FindWindow(ID_CHK_FLT_LIMIT);
+ }
+ wxTextCtrl* GetTextFilterLimit() {
+ return (wxTextCtrl*)FindWindow(ID_TXT_FLT_LIMIT);
+ }
+ wxRadioButton* GetRadioMethodCurSrv() {
+ return (wxRadioButton*)FindWindow(ID_RAD_MET_CURSRV);
+ }
+ wxRadioButton* GetRadioMethodAllSrv() {
+ return (wxRadioButton*)FindWindow(ID_RAD_MET_ALLSRV);
+ }
+ wxRadioButton* GetRadioMethodJigle() {
+ return (wxRadioButton*)FindWindow(ID_RAD_MET_JIGLE);
+ }
+ wxRadioButton* GetRadioMethodFDnk() {
+ return (wxRadioButton*)FindWindow(ID_RAD_MET_FDNK);
+ }
+ wxFlexGridSizer *mainsizer; /* Main sizer of this page */
+ wxFlexGridSizer *s_filters; /* SB filters page checkboxes sizer */
+ wxPanel *sidebar; /* Hm, I think its the sidebar... */
+ CSearchListCtrl *list; /* And what could this be ? */
};
Index: ServerWnd.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/ServerWnd.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- ServerWnd.cpp 29 Dec 2003 19:02:13 -0000 1.57
+++ ServerWnd.cpp 13 Jan 2004 23:10:26 -0000 1.58
@@ -314,7 +314,7 @@
to any server on startup")
);
#endif
- item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 );
+ item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5 );
wxBoxSizer *item2 = new wxBoxSizer( wxHORIZONTAL );
@@ -328,7 +328,7 @@
to servers marked as \"static\" only")
);
#endif
- item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|border_style, 5 );
+ item2->Add( item3, 0, wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5 );
item0->Add( item2, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT, 15 );
@@ -368,7 +368,7 @@
removed from list if they do not respond")
);
#endif
- item9->Add( item10, 0, wxALIGN_CENTER|border_style, 5 );
+ item9->Add( item10, 0, wxALIGN_CENTER|BORDERSTYLE, 5 );
item8->Add( item9, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
@@ -432,7 +432,7 @@
for log boxes (saves memory)")
);
#endif
- item1->Add( item2, 0, wxGROW|border_style, 5 );
+ item1->Add( item2, 0, wxGROW|BORDERSTYLE, 5 );
wxTextCtrl *item3 = new wxTextCtrl(
parent, ID_TXT_LINE_LIMIT, wxT(""),
@@ -452,7 +452,7 @@
#ifndef __WXX11__
item4->SetToolTip( _("Save logs to disc also") );
#endif
- item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|border_style, 5 );
+ item0->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL|BORDERSTYLE, 5 );
wxButton *item5 = new wxButton(
parent, ID_BTN_CLEAR_LOGS, _("Clear"),
Index: defines.h
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/defines.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- defines.h 30 Dec 2003 13:32:23 -0000 1.46
+++ defines.h 13 Jan 2004 23:10:26 -0000 1.47
@@ -51,9 +51,9 @@
* required. Thus we define it here and use where needed.
*/
#if defined(__WXMSW__) || defined (__WXX11__)
- #define border_style wxALL
+ #define BORDERSTYLE wxALL
#else
- #define border_style 0
+ #define BORDERSTYLE 0
#endif
/**
@@ -157,6 +157,31 @@
ID_LOG,
ID_DEBUGLOG,
+ /* Search page */
+ ID_BTN_TOGGLE_SEARCH_SIDEBAR,
+ ID_SEARCH_STRING,
+ ID_SEARCH,
+ ID_FLT_ALL,
+ ID_FLT_VID,
+ ID_FLT_AUD,
+ ID_FLT_ARC,
+ ID_FLT_CDI,
+ ID_FLT_PIC,
+ ID_FLT_APP,
+ ID_FLT_DOC,
+ ID_CHK_FLT_SIZE_L,
+ ID_TXT_FLT_SIZE_L,
+ ID_CHK_FLT_SIZE_S,
+ ID_TXT_FLT_SIZE_S,
+ ID_CHK_FLT_SRC_M,
+ ID_TXT_FLT_SRC_M,
+ ID_CHK_FLT_LIMIT,
+ ID_TXT_FLT_LIMIT,
+ ID_RAD_MET_CURSRV,
+ ID_RAD_MET_ALLSRV,
+ ID_RAD_MET_JIGLE,
+ ID_RAD_MET_FDNK,
+
/* Transfer page */
ID_SPLITTER,
ID_CATEGORY,
Index: wxInterface.wdr
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface.wdr,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
Binary files /tmp/cvsW2v3TX and /tmp/cvsWo17VL differ
Index: wxInterface_wdr.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- wxInterface_wdr.cpp 17 Dec 2003 05:16:01 -0000 1.10
+++ wxInterface_wdr.cpp 13 Jan 2004 23:10:26 -0000 1.11
@@ -40,7 +40,6 @@
*/
#include "ServerListCtrl.h"
-#include "SearchListCtrl.h"
#include "SharedFilesListCtrl.h"
#include "StatisticsTreeCtrl.h"
#include "ColorFrameCtrl.h"
@@ -48,199 +47,6 @@
// Implement window functions
-wxSizer *SearchWnd( wxWindow *parent, bool call_fit, bool set_sizer )
-{
- wxFlexGridSizer *item0 = new wxFlexGridSizer( 6, 0, 0, 0 );
- item0->AddGrowableCol( 0 );
- item0->AddGrowableRow( 2 );
-
- wxFlexGridSizer *item1 = new wxFlexGridSizer( 1, 0, 0, 0 );
- item1->AddGrowableCol( 2 );
- item1->AddGrowableRow( 0 );
-
- wxStaticBox *item3 = new wxStaticBox( parent, -1, _("Search") );
- wxStaticBoxSizer *item2 = new wxStaticBoxSizer( item3, wxVERTICAL );
-
- wxStaticText *item4 = new wxStaticText( parent, ID_TEXT, _("Name"), wxDefaultPosition, wxDefaultSize, 0 );
- item2->Add( item4, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item5 = new wxTextCtrl( parent, ID_SEARCHSTRING, wxT(""), wxDefaultPosition, wxSize(80,-1), wxTE_PROCESS_ENTER );
- item2->Add( item5, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- wxFlexGridSizer *item6 = new wxFlexGridSizer( 3, 0, 0 );
-
- wxStaticText *item7 = new wxStaticText( parent, ID_TEXT, _("Method"), wxDefaultPosition, wxDefaultSize, 0 );
- item6->Add( item7, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxStaticText *item8 = new wxStaticText( parent, ID_TEXT, _("Type"), wxDefaultPosition, wxDefaultSize, 0 );
- item6->Add( item8, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- item6->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
-
- wxString strs9[] =
- {
- _("Global"),
- _("Server")
- };
- wxChoice *item9 = new wxChoice( parent, ID_SEARCHMETHOD, wxDefaultPosition, wxSize(100,-1), 2, strs9, 0 );
- item6->Add( item9, 0, wxALIGN_CENTER, 5 );
-
- wxString strs10[] =
- {
- _("Any"),
- _("Video"),
- _("Audio"),
- _("Archive"),
- _("Text"),
- _("Image")
- };
- wxChoice *item10 = new wxChoice( parent, ID_SEARCHTYPE, wxDefaultPosition, wxSize(100,-1), 6, strs10, 0 );
- item6->Add( item10, 0, wxALIGN_CENTER, 5 );
-
- wxButton *item11 = new wxButton( parent, ID_BTN_RESET, _("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
- item6->Add( item11, 0, wxGROW, 5 );
-
- item2->Add( item6, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- item1->Add( item2, 0, wxGROW, 5 );
-
- wxStaticBox *item13 = new wxStaticBox( parent, -1, _("Filter") );
- wxStaticBoxSizer *item12 = new wxStaticBoxSizer( item13, wxVERTICAL );
-
- wxBoxSizer *item14 = new wxBoxSizer( wxHORIZONTAL );
-
- wxBoxSizer *item15 = new wxBoxSizer( wxVERTICAL );
-
- wxStaticText *item16 = new wxStaticText( parent, ID_TEXT, _("min Size"), wxDefaultPosition, wxDefaultSize, 0 );
- item15->Add( item16, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item17 = new wxTextCtrl( parent, ID_MINSIZE, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
- item15->Add( item17, 0, wxALIGN_CENTER, 5 );
-
- item14->Add( item15, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 );
-
- wxStaticText *item18 = new wxStaticText( parent, ID_TEXT, wxT("MB"), wxDefaultPosition, wxDefaultSize, 0 );
- item14->Add( item18, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 );
-
- wxBoxSizer *item19 = new wxBoxSizer( wxVERTICAL );
-
- wxStaticText *item20 = new wxStaticText( parent, ID_TEXT, _("max Size"), wxDefaultPosition, wxDefaultSize, 0 );
- item19->Add( item20, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item21 = new wxTextCtrl( parent, ID_MAXSIZE, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
- item19->Add( item21, 0, wxALIGN_CENTER, 5 );
-
- item14->Add( item19, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 );
-
- wxStaticText *item22 = new wxStaticText( parent, ID_TEXT, wxT("MB"), wxDefaultPosition, wxDefaultSize, 0 );
- item14->Add( item22, 0, wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 );
-
- item12->Add( item14, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- wxBoxSizer *item23 = new wxBoxSizer( wxHORIZONTAL );
-
- wxBoxSizer *item24 = new wxBoxSizer( wxVERTICAL );
-
- wxStaticText *item25 = new wxStaticText( parent, ID_TEXT, _("Availability"), wxDefaultPosition, wxDefaultSize, 0 );
- item24->Add( item25, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item26 = new wxTextCtrl( parent, ID_AVAIL, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
- item24->Add( item26, 0, wxALIGN_CENTER, 5 );
-
- item23->Add( item24, 0, wxALIGN_CENTER, 5 );
-
- item23->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 0 );
-
- wxBoxSizer *item27 = new wxBoxSizer( wxVERTICAL );
-
- wxStaticText *item28 = new wxStaticText( parent, ID_TEXT, _("Extension"), wxDefaultPosition, wxDefaultSize, 0 );
- item27->Add( item28, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item29 = new wxTextCtrl( parent, ID_EXTENSION, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
- item27->Add( item29, 0, wxALIGN_CENTER, 5 );
-
- item23->Add( item27, 0, wxGROW|wxALIGN_CENTER_HORIZONTAL, 5 );
-
- item12->Add( item23, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- item1->Add( item12, 0, wxGROW|wxLEFT, 5 );
-
- wxStaticBox *item31 = new wxStaticBox( parent, -1, _("Direct Download") );
- wxStaticBoxSizer *item30 = new wxStaticBoxSizer( item31, wxVERTICAL );
-
- wxStaticText *item32 = new wxStaticText( parent, ID_TEXT, _("ED2K Link(s)"), wxDefaultPosition, wxDefaultSize, 0 );
- item30->Add( item32, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- wxTextCtrl *item33 = new wxTextCtrl( parent, ID_TEXTCTRL, wxT(""), wxDefaultPosition, wxSize(-1,85), wxTE_MULTILINE );
- item30->Add( item33, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- item1->Add( item30, 0, wxGROW|wxLEFT, 5 );
-
- item0->Add( item1, 0, wxGROW|wxALL, 5 );
-
- wxFlexGridSizer *item34 = new wxFlexGridSizer( 2, 0, 0 );
- item34->AddGrowableCol( 0 );
-
- wxBoxSizer *item35 = new wxBoxSizer( wxHORIZONTAL );
-
- wxStaticBitmap *item36 = new wxStaticBitmap( parent, ID_SEARCH_RESULTS_IMAGE, Icons( 0 ), wxDefaultPosition, wxDefaultSize );
- item35->Add( item36, 0, wxALIGN_CENTER|wxALL, 5 );
-
- wxStaticText *item37 = new wxStaticText( parent, ID_TEXT, _("Search Results"), wxDefaultPosition, wxDefaultSize, 0 );
- item35->Add( item37, 0, wxALIGN_CENTER|wxRIGHT|wxTOP|wxBOTTOM, 5 );
-
- item34->Add( item35, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- wxBoxSizer *item38 = new wxBoxSizer( wxHORIZONTAL );
-
- wxButton *item39 = new wxButton( parent, ID_BUTTON, _("Start"), wxDefaultPosition, wxDefaultSize, 0 );
- item38->Add( item39, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
-
- wxButton *item40 = new wxButton( parent, ID_BUTTON, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
- item40->Enable( FALSE );
- item38->Add( item40, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
-
- item34->Add( item38, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
-
- item0->Add( item34, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
-
- CSearchListCtrl *item41 = new CSearchListCtrl( parent, ID_SEARCHRESULTS, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER );
- item0->Add( item41, 0, wxGROW|wxLEFT|wxRIGHT, 5 );
-
- wxGauge *item42 = new wxGauge( parent, ID_GAUGE, 100, wxDefaultPosition, wxSize(100,10), 0 );
- item0->Add( item42, 0, wxGROW|wxLEFT|wxRIGHT, 5 );
-
- wxBoxSizer *item43 = new wxBoxSizer( wxHORIZONTAL );
-
- wxButton *item44 = new wxButton( parent, ID_BUTTON, _("Download Selected"), wxDefaultPosition, wxDefaultSize, wxNO_BORDER );
- item43->Add( item44, 0, wxALIGN_CENTER|wxALL, 5 );
-
- wxStaticText *item45 = new wxStaticText( parent, ID_TEXT, wxT("->"), wxDefaultPosition, wxDefaultSize, 0 );
- item45->SetFont( wxFont( 12, wxMODERN, wxNORMAL, wxNORMAL ) );
-#if defined(__WXMSW__) && !(wxCHECK_VERSION(2,3,0))
- item45->SetSize( item45->GetBestSize() );
-#endif
- item43->Add( item45, 0, wxALIGN_CENTER|wxALL, 5 );
-
- wxButton *item46 = new wxButton( parent, ID_BUTTON, _("All"), wxDefaultPosition, wxDefaultSize, 0 );
- item43->Add( item46, 0, wxALIGN_CENTER|wxALL, 5 );
-
- item0->Add( item43, 0, wxALIGN_CENTER_VERTICAL, 5 );
-
- if (set_sizer)
- {
- parent->SetAutoLayout( TRUE );
- parent->SetSizer( item0 );
- if (call_fit)
- {
- item0->Fit( parent );
- item0->SetSizeHints( parent );
- }
- }
-
- return item0;
-}
-
wxSizer *SharedFilesWnd( wxWindow *parent, bool call_fit, bool set_sizer )
{
wxFlexGridSizer *item0 = new wxFlexGridSizer( 4, 0, 0, 0 );
Index: wxInterface_wdr.h
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/wxInterface_wdr.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- wxInterface_wdr.h 17 Dec 2003 05:16:01 -0000 1.5
+++ wxInterface_wdr.h 13 Jan 2004 23:10:26 -0000 1.6
@@ -28,77 +28,64 @@
// Declare window functions
-#define ID_TEXT 10000
-#define ID_SEARCHSTRING 10001
-#define ID_SEARCHMETHOD 10002
-#define ID_SEARCHTYPE 10003
-#define ID_BTN_RESET 10004
-#define ID_MINSIZE 10005
-#define ID_MAXSIZE 10006
-#define ID_AVAIL 10007
-#define ID_EXTENSION 10008
-#define ID_TEXTCTRL 10009
-#define ID_SEARCH_RESULTS_IMAGE 10010
-#define ID_BUTTON 10011
-#define ID_SEARCHRESULTS 10012
-#define ID_GAUGE 10013
-wxSizer *SearchWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-
-#define ID_SHARED_FILES_IMAGE 10014
-#define ID_TXT_SHARED 10015
-#define ID_SHAREDLISTCTRL 10016
-#define ID_CURSES_REQUESTS 10017
-#define ID_CURSES_ACCEPTED_UPLOADS 10018
-#define ID_CURSES_TRANSFERRED 10019
-#define ID_G_REQUESTS 10020
-#define ID_G_UPLOADS 10021
-#define ID_G_TRANSFERRED 10022
-#define ID_TOTAL_REQUESTS 10023
-#define ID_TOTAL_ACCEPTED_UPLOADS 10024
-#define ID_TOTAL_TRANSFERRED 10025
+#define ID_SHARED_FILES_IMAGE 10000
+#define ID_TXT_SHARED 10001
+#define ID_SHAREDLISTCTRL 10002
+#define ID_TEXT 10003
+#define ID_CURSES_REQUESTS 10004
+#define ID_CURSES_ACCEPTED_UPLOADS 10005
+#define ID_CURSES_TRANSFERRED 10006
+#define ID_G_REQUESTS 10007
+#define ID_G_UPLOADS 10008
+#define ID_G_TRANSFERRED 10009
+#define ID_TOTAL_REQUESTS 10010
+#define ID_TOTAL_ACCEPTED_UPLOADS 10011
+#define ID_TOTAL_TRANSFERRED 10012
wxSizer *SharedFilesWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-#define ID_FRIEND_IMAGE 10026
-#define ID_LISTCTRL 10027
-#define ID_MESSAGES_IMAGE 10028
-#define ID_NOTEBOOK 10029
+#define ID_FRIEND_IMAGE 10013
+#define ID_LISTCTRL 10014
+#define ID_MESSAGES_IMAGE 10015
+#define ID_NOTEBOOK 10016
+#define ID_TEXTCTRL 10017
+#define ID_BUTTON 10018
wxSizer *MessagesWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-#define BTN_STAT 10030
-#define ID_STATSTREECTRL 10031
-#define ID_FOREIGN 10032
-#define ID_CON_GRAPH 10033
-#define ID_DL_SES 10034
-#define ID_DL_CUR 10035
-#define ID_DL_AVG 10036
-#define ID_DL_GRAPH 10037
-#define ID_UL_SES 10038
-#define ID_UL_CUR 10039
-#define ID_UL_AVG 10040
-#define ID_UL_GRAPH 10041
+#define BTN_STAT 10019
+#define ID_STATSTREECTRL 10020
+#define ID_FOREIGN 10021
+#define ID_CON_GRAPH 10022
+#define ID_DL_SES 10023
+#define ID_DL_CUR 10024
+#define ID_DL_AVG 10025
+#define ID_DL_GRAPH 10026
+#define ID_UL_SES 10027
+#define ID_UL_CUR 10028
+#define ID_UL_AVG 10029
+#define ID_UL_GRAPH 10030
wxSizer *StatisticsWnd( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-#define ID_LANG_NAME 10042
-#define ID_BTN_ADD_LANG_OK 10043
-#define ID_BTN_ADD_LANG_CANCEL 10044
+#define ID_LANG_NAME 10031
+#define ID_BTN_ADD_LANG_OK 10032
+#define ID_BTN_ADD_LANG_CANCEL 10033
wxSizer *Dlg_AddLanguage( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-#define ID_BTN_ADDICONSET_OK 10045
-#define ID_BTN_ADDICONSET_CANCEL 10046
+#define ID_BTN_ADDICONSET_OK 10034
+#define ID_BTN_ADDICONSET_CANCEL 10035
wxSizer *Dlg_AddIconSet( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
-#define ID_LINE 10047
-#define ID_STATUS_TXT 10048
-#define ID_BMP_STATUS_USERS 10049
-#define ID_STATUS_USERS 10050
-#define ID_BMP_STATUS_FILES 10051
-#define ID_STATUS_FILES 10052
-#define ID_BMP_STATUS_UPLOAD 10053
-#define ID_STATUS_UPLOAD 10054
-#define ID_BMP_STATUS_DLOAD 10055
-#define ID_STATUS_DLOAD 10056
-#define ID_BMP_STATUS_CONNECTION 10057
-#define ID_STATUS_CONNECTION 10058
+#define ID_LINE 10036
+#define ID_STATUS_TXT 10037
+#define ID_BMP_STATUS_USERS 10038
+#define ID_STATUS_USERS 10039
+#define ID_BMP_STATUS_FILES 10040
+#define ID_STATUS_FILES 10041
+#define ID_BMP_STATUS_UPLOAD 10042
+#define ID_STATUS_UPLOAD 10043
+#define ID_BMP_STATUS_DLOAD 10044
+#define ID_STATUS_DLOAD 10045
+#define ID_BMP_STATUS_CONNECTION 10046
+#define ID_STATUS_CONNECTION 10047
wxSizer *StatusBar( wxWindow *parent, bool call_fit = TRUE, bool set_sizer = TRUE );
// Declare menubar functions
@@ -107,7 +94,7 @@
// Declare bitmap functions
-#define ID_NULL_BMP 10059
+#define ID_NULL_BMP 10048
wxBitmap Icons( size_t index );
#endif
|