]> git.saurik.com Git - wxWidgets.git/blame - src/xrc/xh_gdctl.cpp
Don't set insertion point if the text is the same in SetValue
[wxWidgets.git] / src / xrc / xh_gdctl.cpp
CommitLineData
995c1788
VS
1/////////////////////////////////////////////////////////////////////////////
2// Name: xh_gdctl.cpp
3// Purpose: XRC resource for wxGenericDirCtrl
4// Author: Markus Greither
5// Created: 2002/01/20
6// RCS-ID:
7// Copyright: (c) 2002 Markus Greither
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifdef __GNUG__
12#pragma implementation "xh_gdctl.h"
13#endif
14
15// For compilers that support precompilation, includes "wx.h".
16#include "wx/wxprec.h"
17
18#ifdef __BORLANDC__
19 #pragma hdrstop
20#endif
21
22#include "wx/defs.h"
23#if wxUSE_DIRDLG
24
25#include "wx/textctrl.h"
26#include "wx/xrc/xh_gdctl.h"
27#include "wx/dirctrl.h"
28
854e189f
VS
29IMPLEMENT_DYNAMIC_CLASS(wxGenericDirCtrlXmlHandler, wxXmlResourceHandler)
30
995c1788
VS
31wxGenericDirCtrlXmlHandler::wxGenericDirCtrlXmlHandler()
32: wxXmlResourceHandler()
33{
66010e8d
VS
34 XRC_ADD_STYLE(wxDIRCTRL_DIR_ONLY);
35 XRC_ADD_STYLE(wxDIRCTRL_3D_INTERNAL);
36 XRC_ADD_STYLE(wxDIRCTRL_SELECT_FIRST);
37 XRC_ADD_STYLE(wxDIRCTRL_SHOW_FILTERS);
995c1788
VS
38 AddWindowStyles();
39}
40
41wxObject *wxGenericDirCtrlXmlHandler::DoCreateResource()
42{
43 XRC_MAKE_INSTANCE(ctrl, wxGenericDirCtrl)
44
45 ctrl->Create(m_parentAsWindow,
46 GetID(),
47 GetText(wxT("defaultfolder")),
48 GetPosition(), GetSize(),
49 GetStyle(),
50 GetText(wxT("filter")),
51 (int)GetLong(wxT("defaultfilter")),
52 GetName());
53
54 SetupWindow(ctrl);
55
56 return ctrl;
57}
58
59bool wxGenericDirCtrlXmlHandler::CanHandle(wxXmlNode *node)
60{
61 return IsOfClass(node, wxT("wxGenericDirCtrl"));
62}
63
64#endif