2 // This file is part of the aMule Project.
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002 quekky
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <wx/dialog.h> // Needed for wxDialog
30 #include "Types.h" // Needed for uint32
31 #include "OtherStructs.h"
39 * This dialog takes of displaying either existing or new categories, so that
40 * the user can add or change them.
42 * It is a self-contained entity, and does not rely on the categories staying
43 * the same while the dialog is visble, though it will overwrite any changes
44 * made to the selected category in the mean time. Also, if the selected category
45 * has been deleted then it will simply be readded.
47 * It does however rely on the Transferwnd keeping its own list of categories up-
50 class CCatDialog
: public wxDialog
56 * @param parent The parent of the new dialog.
57 * @param catindex The category to be edited.
59 * The parameter catindex can be a valid index, in which case that category
60 * will be selected, or it can be less than zero, in which case a new
61 * category will be created.
63 CCatDialog(wxWindow
* parent
, bool allowbrowse
, int catindex
= -1 );
72 * Helper function for making the color-preview.
74 * @param colour The color with which to fill the bitmap.
76 * This function creates a single-color 16x16 image, using the
79 wxBitmap
MakeBitmap( wxColour colour
);
82 //! Variable used to store the user-selected color.
85 //! Pointer to category to be edited or NULL if we are adding a new category.
86 Category_Struct
* m_category
;
90 * Event-handler for selecting incomming dir.
92 void OnBnClickedBrowse(wxCommandEvent
& evt
);
95 * Event-handler for saving the changes.
97 void OnBnClickedOk(wxCommandEvent
& evt
);
100 * Event-handler for selecting category color.
102 void OnBnClickColor(wxCommandEvent
& evt
);
104 DECLARE_EVENT_TABLE()
108 // File_checked_for_headers