SPH
Functions
Utils.cpp File Reference
#include "gui/Utils.h"
#include "common/Assert.h"
#include "io/FileSystem.h"
#include "objects/utility/StringUtils.h"
#include <iomanip>
#include <wx/dcmemory.h>
#include <wx/filedlg.h>

Go to the source code of this file.

Functions

Optional< PathdoOpenFileDialog (const std::string &title, Array< FileFormat > &&formats)
 
Optional< PathdoSaveFileDialog (const std::string &title, Array< FileFormat > &&formats)
 
void drawTextWithSubscripts (wxDC &dc, const std::wstring &text, const wxPoint point)
 
void drawTextWithSubscripts (wxDC &dc, const std::string &text, const wxPoint point)
 
std::wstring toPrintableString (const Float value, const Size precision, const Float decimalThreshold)
 Converts the value to a printable string. More...
 
void printLabels (wxDC &dc, ArrayView< const IRenderOutput::Label > labels)
 

Function Documentation

◆ doOpenFileDialog()

Optional<Path> doOpenFileDialog ( const std::string &  title,
Array< FileFormat > &&  formats 
)

Definition at line 45 of file Utils.cpp.

◆ doSaveFileDialog()

Optional<Path> doSaveFileDialog ( const std::string &  title,
Array< FileFormat > &&  formats 
)

Definition at line 56 of file Utils.cpp.

◆ drawTextWithSubscripts() [1/2]

void drawTextWithSubscripts ( wxDC &  dc,
const std::string &  text,
const wxPoint  point 
)

Definition at line 117 of file Utils.cpp.

◆ drawTextWithSubscripts() [2/2]

void drawTextWithSubscripts ( wxDC &  dc,
const std::wstring &  text,
const wxPoint  point 
)

Draws a text into the DC using current font and color, replacing all _x with corresponding subscript character.

Definition at line 86 of file Utils.cpp.

◆ printLabels()

void printLabels ( wxDC &  dc,
ArrayView< const IRenderOutput::Label labels 
)

Definition at line 186 of file Utils.cpp.

◆ toPrintableString()

std::wstring toPrintableString ( const Float  value,
const Size  precision,
const Float  decimalThreshold 
)

Converts the value to a printable string.

Definition at line 121 of file Utils.cpp.