list_dialog.h

Go to the documentation of this file.
00001 #ifndef LIST_DIALOG_CLASS
00002 #define LIST_DIALOG_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : list_dialog                                                       *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2008-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "mfc_dll.h"
00019 
00020 #include <basis/object_base.h>
00021 #include <basis/portable.h>
00022 
00023 // forward.
00024 class byte_array;
00025 class list_dialog_implementation;
00026 class string_array;
00027 
00029 
00030 class MFC_EXTENSIONS_CLASS_STYLE list_dialog : public CDialog
00031 {
00032 public:
00033   list_dialog(CWnd *parent = NIL,
00034       const istring &title = istring::empty_string(), bool on_top = true);
00035   virtual ~list_dialog();
00036   IMPLEMENT_CLASS_NAME("list_dialog");
00037 
00038   int add_string(const istring &to_add, bool enabled = true);
00040 
00041   int get_current(istring &selection);
00043 
00044 protected:
00045   DECLARE_MESSAGE_MAP()
00046   virtual BOOL OnInitDialog();
00047   afx_msg void OnSelchangeTypesListbox();
00048   virtual void OnOK();
00049   afx_msg void OnDblClkListbox();
00050   virtual void DoDataExchange(CDataExchange* ddx_ptr);
00051 
00052 private:
00053   istring *_title;  // the title for the dialog.
00054   bool _on_top;  // true when the dialog should be top-most.
00055   int _selection_indy;  // current position of the selection.
00056   int _last_selection_indy;  // previous position of selection.
00057   string_array *_list_items;  // the current set of items held.
00058   byte_array *_enabled_items;  // tracks which items are enabled.
00059   list_dialog_implementation *_implementation;  // lower-level mfc object.
00060 };
00061 
00062 #endif
00063 

Generated on Fri Nov 28 04:28:59 2008 for HOOPLE Libraries by  doxygen 1.5.1