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-2008 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"
32 #include "MuleColour.h"
38 * This dialog takes of displaying either existing or new categories, so that
39 * the user can add or change them.
41 * It is a self-contained entity, and does not rely on the categories staying
42 * the same while the dialog is visble, though it will overwrite any changes
43 * made to the selected category in the mean time. Also, if the selected category
44 * has been deleted then it will simply be readded.
46 * It does however rely on the Transferwnd keeping its own list of categories up-
49 class CCatDialog
: public wxDialog
55 * @param parent The parent of the new dialog.
56 * @param catindex The category to be edited.
58 * The parameter catindex can be a valid index, in which case that category
59 * will be selected, or it can be less than zero, in which case a new
60 * category will be created.
62 CCatDialog(wxWindow
* parent
, bool allowbrowse
, int catindex
= -1 );
71 * Helper function for making the color-preview.
73 * This function creates a single-color 16x16 image, using the
74 * m_colour member variable.
76 wxBitmap
MakeBitmap();
78 //! Variable used to store the user-selected color.
81 //! Pointer to category to be edited or NULL if we are adding a new category.
82 Category_Struct
* m_category
;
86 * Event-handler for selecting incomming dir.
88 void OnBnClickedBrowse(wxCommandEvent
& evt
);
91 * Event-handler for saving the changes.
93 void OnBnClickedOk(wxCommandEvent
& evt
);
96 * Event-handler for selecting category color.
98 void OnBnClickColor(wxCommandEvent
& evt
);
100 DECLARE_EVENT_TABLE()
104 // File_checked_for_headers