19#include <gwenhywfar/debug.h>
24 : m_parentId(parentId)
27 , m_type(WIN_SCOPE_TYPE_WINDOW) {
43 , m_type(WIN_SCOPE_TYPE_WINDOW) {
53 : m_parentId(parentId)
134 WinScopePtrList::iterator it;
139 if ((*it)->getId()==
id)
149 return m_app->getActiveWindow();
168 WinScopePtrList::iterator it;
175 switch((*it)->getType()) {
183 fprintf(stderr,
"WinScope: id %08x, parent %08x, type %s\n",
185 (*it)->getParentId(),
213 while ((p=strchr(p,
'<'))) {
218 if (toupper(*t)==
'H') {
220 if (toupper(*t)==
'T') {
222 if (toupper(*t)==
'M') {
224 if (toupper(*t)==
'L') {
226 if (toupper(*t)==
'>') {
240 while ((p2=strchr(p2,
'<'))) {
245 if (toupper(*t)==
'/') {
247 if (toupper(*t)==
'H') {
249 if (toupper(*t)==
'T') {
251 if (toupper(*t)==
'M') {
253 if (toupper(*t)==
'L') {
255 if (toupper(*t)==
'>') {
270 int startPos=(p-text);
271 int endPos=(p2-text);
274 result=FXString(text);
275 result.erase(startPos, endPos);
279 return FXString(text);
293 while ((p=strchr(p,
'<'))) {
298 if (toupper(*t)==
'H') {
300 if (toupper(*t)==
'T') {
302 if (toupper(*t)==
'M') {
304 if (toupper(*t)==
'L') {
306 if (toupper(*t)==
'>') {
320 while ((p2=strchr(p2,
'<'))) {
325 if (toupper(*t)==
'/') {
327 if (toupper(*t)==
'H') {
329 if (toupper(*t)==
'T') {
331 if (toupper(*t)==
'M') {
333 if (toupper(*t)==
'L') {
335 if (toupper(*t)==
'>') {
348 return FXString(p, p2-p);
350 return FXString(text);
360 owner=
m_app->getActiveWindow();
363 if (!(foxDlg.
setup(owner))) {
377 owner=
m_app->getActiveWindow();
382 if (!(foxDlg->
setup(owner))) {
417 return foxDlg->
cont();
429 const char *patterns,
439 sCaption=FXString(caption);
449 str=FXString(s1, s2-s1);
458 if (str.contains(
'(')) {
459 if (!sPatterns.empty())
461 sPatterns+=str.before(
'(');
464 sPatterns+=str.substitute(
';',
',');
467 if (!sPatterns.empty())
469 sPatterns+=str.substitute(
';',
',');
479 owner=
m_app->getModalWindow();
481 owner=
m_app->getActiveWindow();
484 owner=
m_app->getRootWindow();
493 str=FXFileDialog::getOpenFilename(owner, sCaption, sPath, sPatterns, 0);
497 str=FXFileDialog::getSaveFilename(owner, sCaption, sPath, sPatterns, 0);
501 str=FXFileDialog::getOpenDirectory(owner, sCaption, sPath);
520 uint32_t fontFlags) {
532 strcasecmp(s, fontName)==0)
544 uint32_t fontFlags) {
547 fnt=
findFont(fontName, fontSize, fontFlags);
void GWEN_Buffer_Reset(GWEN_BUFFER *bf)
int GWEN_Buffer_AppendString(GWEN_BUFFER *bf, const char *buffer)
uint32_t GWEN_Buffer_GetUsedBytes(const GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
A C++ binding for the C module GWEN_GUI.
static CPPGUI_API CppGui * getCppGui()
static FOX16_GuiDialog * getDialog(GWEN_DIALOG *dlg)
bool setup(FXWindow *parentWindow)
WinScope(uint32_t parentId, FXWindow *w)
int print(const char *docTitle, const char *docType, const char *descr, const char *text, uint32_t guiid)
int getFileName(const char *caption, GWEN_GUI_FILENAME_TYPE fnt, uint32_t flags, const char *patterns, GWEN_BUFFER *pathBuffer, uint32_t guiid)
virtual int openDialog(GWEN_DIALOG *dlg, uint32_t guiid)
static FOX16GUI_API FXString getHtmlText(const char *text)
HTML_FONT_LIST * m_fontList
static FOX16GUI_API FXString getRawText(const char *text)
FXWindow * getGuiWindow(uint32_t id)
WinScope * findWinScope(uint32_t id)
void addWinScope(WinScope *ws)
static FOX16GUI_API FOX16_Gui * getFgGui()
virtual int runDialog(GWEN_DIALOG *dlg, int untilEnd)
void delWinScope(WinScope *ws)
WinScopePtrList m_scopeList
HTML_FONT * findFont(const char *fontName, int fontSize, uint32_t fontFlags)
uint32_t getIdOfLastScope()
virtual int closeDialog(GWEN_DIALOG *dlg)
HTML_FONT * getFont(const char *fontName, int fontSize, uint32_t fontFlags)
int execDialog(GWEN_DIALOG *dlg, uint32_t guiid)
FOX16_GuiUpdater * m_updater
#define DBG_ERROR(dbg_logger, format, args...)
struct GWEN_DIALOG GWEN_DIALOG
#define GWEN_ERROR_NOT_IMPLEMENTED
#define GWEN_ERROR_INTERNAL
#define GWEN_ERROR_GENERIC
#define GWEN_ERROR_ABORTED
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
void GWEN_Gui_SetName(GWEN_GUI *gui, const char *name)
void GWEN_Gui_AddFlags(GWEN_GUI *gui, uint32_t fl)
@ GWEN_Gui_FileNameType_OpenDirectory
@ GWEN_Gui_FileNameType_SaveFileName
@ GWEN_Gui_FileNameType_OpenFileName
#define GWEN_GUI_FLAGS_DIALOGSUPPORTED
GWENHYWFAR_API void GWEN_Gui_UseDialogs(GWEN_GUI *gui)
int HtmlFont_GetFontSize(const HTML_FONT *fnt)
void HtmlFont_SetFontSize(HTML_FONT *fnt, int i)
void HtmlFont_SetFontName(HTML_FONT *fnt, const char *s)
void HtmlFont_SetFontFlags(HTML_FONT *fnt, uint32_t i)
uint32_t HtmlFont_GetFontFlags(const HTML_FONT *fnt)
const char * HtmlFont_GetFontName(const HTML_FONT *fnt)
HTML_FONT * HtmlFont_new(void)
struct HTML_FONT HTML_FONT
HTML_FONT * HtmlFont_List_Next(const HTML_FONT *element)
void HtmlFont_List_free(HTML_FONT_LIST *l)
HTML_FONT_LIST * HtmlFont_List_new()
HTML_FONT * HtmlFont_List_First(const HTML_FONT_LIST *l)
void HtmlFont_List_Add(HTML_FONT *element, HTML_FONT_LIST *list)