These styles allow to use a smaller browse button as the standard one takes too much space, often leaving too little of it for the more important text control part. Notice that both styles are, in fact, equal to wxPB_SMALL but only file and directory pickers currently use it as it doesn't make sense for the colour and font pickers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// Name: src/xrc/xh_filepicker.cpp
|
|
// Purpose: XML resource handler for wxFilePickerCtrl
|
|
// Author: Francesco Montorsi
|
|
// Created: 2006-04-17
|
|
// RCS-ID: $Id$
|
|
// Copyright: (c) 2006 Francesco Montorsi
|
|
// Licence: wxWindows licence
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// For compilers that support precompilation, includes "wx.h".
|
|
#include "wx/wxprec.h"
|
|
|
|
#ifdef __BORLANDC__
|
|
#pragma hdrstop
|
|
#endif
|
|
|
|
#if wxUSE_XRC && wxUSE_FILEPICKERCTRL
|
|
|
|
#include "wx/xrc/xh_filepicker.h"
|
|
#include "wx/filepicker.h"
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(wxFilePickerCtrlXmlHandler, wxXmlResourceHandler)
|
|
|
|
wxFilePickerCtrlXmlHandler::wxFilePickerCtrlXmlHandler() : wxXmlResourceHandler()
|
|
{
|
|
XRC_ADD_STYLE(wxFLP_OPEN);
|
|
XRC_ADD_STYLE(wxFLP_SAVE);
|
|
XRC_ADD_STYLE(wxFLP_OVERWRITE_PROMPT);
|
|
XRC_ADD_STYLE(wxFLP_FILE_MUST_EXIST);
|
|
XRC_ADD_STYLE(wxFLP_CHANGE_DIR);
|
|
XRC_ADD_STYLE(wxFLP_SMALL);
|
|
XRC_ADD_STYLE(wxFLP_DEFAULT_STYLE);
|
|
XRC_ADD_STYLE(wxFLP_USE_TEXTCTRL);
|
|
AddWindowStyles();
|
|
}
|
|
|
|
wxObject *wxFilePickerCtrlXmlHandler::DoCreateResource()
|
|
{
|
|
XRC_MAKE_INSTANCE(picker, wxFilePickerCtrl)
|
|
|
|
picker->Create(m_parentAsWindow,
|
|
GetID(),
|
|
GetParamValue(wxT("value")),
|
|
GetText(wxT("message")),
|
|
GetParamValue(wxT("wildcard")),
|
|
GetPosition(), GetSize(),
|
|
GetStyle(wxT("style"), wxFLP_DEFAULT_STYLE),
|
|
wxDefaultValidator,
|
|
GetName());
|
|
|
|
SetupWindow(picker);
|
|
return picker;
|
|
}
|
|
|
|
bool wxFilePickerCtrlXmlHandler::CanHandle(wxXmlNode *node)
|
|
{
|
|
return IsOfClass(node, wxT("wxFilePickerCtrl"));
|
|
}
|
|
|
|
#endif // wxUSE_XRC && wxUSE_FILEPICKERCTRL
|