NCBI C++ ToolKit
dialog_utils.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: dialog_utils.cpp 17671 2008-08-30 18:30:30Z dicuccio $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrey Yazhuk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
34 
38 
39 
40 #include <wx/ctrlsub.h>
41 
42 
44 
45 
46 void Init_wxControl(wxControlWithItems& control, const vector<string>& values)
47 {
48  for( size_t i = 0; i < values.size(); i++ ) {
49  wxString wx_s(ToWxString(values[i]));
50  control.Append(wx_s);
51  }
52 }
53 
54 
55 wxString GlFontSizeTo_wxString(const CGlBitmapFont& font)
56 {
59  return ToWxString(str);
60 }
61 
62 
63 wxString GlFontFaceTo_wxString(const CGlBitmapFont& font)
64 {
66  string str = CGlBitmapFont::FaceToString(face);
67  return ToWxString(str);
68 }
69 
70 
71 void wxStringsToGlFont(CGlBitmapFont& font, const wxString& wx_face, const wxString& wx_size)
72 {
73  string s_face = ToStdString(wx_face);
75  font.SetFontFace(face);
76 
77  string s_size = ToStdString(wx_size);
79  font.SetFontSize(size);
80 }
81 
82 
wxString GlFontSizeTo_wxString(const CGlBitmapFont &font)
Fucntions below convert CGlBitmapFont size and face to strings and back; handy for using with combobo...
void Init_wxControl(wxControlWithItems &control, const vector< string > &values)
FillComboBox() initializes wxWidgets controls with a list of text strings; works for wxListBox,...
wxString GlFontFaceTo_wxString(const CGlBitmapFont &font)
void wxStringsToGlFont(CGlBitmapFont &font, const wxString &wx_face, const wxString &wx_size)
static const char * str(char *buf, int n)
Definition: stats.c:84
static string SizeToString(EFontSize size)
void SetFontSize(EFontSize size)
static string FaceToString(EFontFace face)
static EFontFace FaceFromString(const string &str)
EFontFace GetFontFace() const
static EFontSize SizeFromString(const string &str)
void SetFontFace(EFontFace face)
EFontSize GetFontSize() const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
int i
const struct ncbi::grid::netcache::search::fields::SIZE size
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Wed Apr 17 13:09:45 2024 by modify_doxy.py rev. 669887