X11workbench Toolkit  1.0
dialog_window.c File Reference

Implementation for dialog (frame) window and intercommunication structures and APIs. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <X11/keysymdef.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "dialog_window.h"
#include "dialog_controls.h"
#include "conf_help.h"
#include "draw_text.h"

Go to the source code of this file.

Data Structures

struct  s_DIALOG_WINDOW
 DIALOG_WINDOW structure, an extension of WBDialogWindow. More...
 

Macros

#define XK_MISCELLANY   /* mostly for interix */
 
#define THIS_SUBSYSTEM   DebugSubSystem_Dialog
 
#define COPY_COLOR_NAME(X, Y, Z)   {const char *pX = X(WBGetDefaultDisplay()); if(pX) strncpy(Y,pX,sizeof(Y)); else strncpy(Y,Z,sizeof(Y));}
 

Typedefs

typedef struct s_DIALOG_WINDOW DIALOG_WINDOW
 DIALOG_WINDOW structure, an extension of WBDialogWindow. More...
 

Enumerations

enum  DlgResourceStringKeywordIndices {
  DlgResourceKW__BEGIN_DIALOG =0,
  DlgResourceKW__END_DIALOG,
  DlgResourceKW__FONT,
  DlgResourceKW__CONTROL,
  DlgResourceKW__ID,
  DlgResourceKW__X,
  DlgResourceKW__Y,
  DlgResourceKW__WIDTH,
  DlgResourceKW__HEIGHT,
  DlgResourceKW__VISIBLE,
  DlgResourceKW__INVISIBLE,
  DlgResourceKW__TITLE,
  DlgResourceKW__VA_DLGTOP,
  DlgResourceKW__VA_DLGBOTTOM,
  DlgResourceKW__VA_DLGCENTER,
  DlgResourceKW__HA_DLGLEFT,
  DlgResourceKW__HA_DLGRIGHT,
  DlgResourceKW__HA_DLGCENTER,
  DlgResourceKW__VRESIZE,
  DlgResourceKW__HRESIZE,
  DlgResourceKW__BORDER,
  DlgResourceKW__NOBORDER,
  DlgResourceKW__CLICKABLE,
  DlgResourceKW__CHECKED,
  DlgResourceKW__ENABLED,
  DlgResourceKW__DISABLED,
  DlgResourceKW__VA_TEXT_TOP,
  DlgResourceKW__VA_TEXT_BOTTOM,
  DlgResourceKW__VA_TEXT_CENTER,
  DlgResourceKW__HA_TEXT_LEFT,
  DlgResourceKW__HA_TEXT_RIGHT,
  DlgResourceKW__HA_TEXT_CENTER
}
 

Functions

static int InternalCreateChildWindows (DIALOG_WINDOW *pDlg, const char *szDialogResource)
 
int DLGDefaultCallback (Window wID, XEvent *pEvent)
 
static void __internal_destroy_dialog_window (DIALOG_WINDOW *pTemp)
 
int DLGPixelHeight (WBDialogWindow *pDlg, int iHeight)
 Height of a single dialog unit (in pixels) More...
 
int DLGPixelWidth (WBDialogWindow *pDlg, int iWidth)
 Width of a single dialog unit (in pixels) More...
 
void WBDialogWindowExit ()
 
static void InternalCheckColors (void)
 
WBDialogWindowDLGCreateDialogWindow (Window wIDOwner, const char *szTitle, const char *szDialogResource, int iX, int iY, int iWidth, int iHeight, WBWinEvent pUserCallback, int iFlags, void *pUserData)
 create a dialog window using a text resource More...
 
void DLGAssignOwner (WBDialogWindow *pDlg, Window wIDOwner)
 Assign owning window to dialog. More...
 
void DLGDestroyDialogWindow (Window wID)
 Destroy a modeless dialog window via its window ID. More...
 
void DLGDestroyDialogWindow2 (WBDialogWindow *pDialogWindow)
 Destroy a modeless dialog window via a pointer to its WBDialogWindow structure. More...
 
void DLGSetUserCallback (WBDialogWindow *pDialogWindow, WBWinEvent pCallBack)
 Assign the callback function for a dialog window. More...
 
void DLGRecalcLayout (Window wID)
 Force re-calculation of dialog window (and control) layout. More...
 
void * DLGGetDialogWindowUserData (Window wID)
 Returns a pointer to the dialog window's 'user data' assigned at create time. More...
 
Window DLGGetDialogControl (WBDialogWindow *pDialog, int iControlID)
 returns the Window ID of a member control of the dialog window using the 'control ID' More...
 
WBDialogEntryDLGGetDialogControlEntry (WBDialogWindow *pDialog, Window idControl)
 returns a pointer to the WBDialogEntry for a member control using the control's Window ID More...
 
Window DLGGetFirstDialogControl (WBDialogWindow *pDialog)
 Return the Window ID of the FIRST dialog control within the 'tab order'. More...
 
Window DLGGetNextDialogControl (WBDialogWindow *pDialog, Window idControl)
 Return the Window ID of the NEXT dialog control within the 'tab order', based on the specified control window ID. More...
 
Window DLGGetPrevDialogControl (WBDialogWindow *pDialog, Window idControl)
 Return the Window ID of the PREVIOUS dialog control within the 'tab order', based on the specified control window ID. More...
 
int DLGProcessHotKey (WBDialogWindow *pDLG, XEvent *pEvent)
 return non-zero if a hot-key was processed and no further processing should be done. Otherwise returns zero.
 
static int InternalCreateChildWindowsSub (DIALOG_WINDOW *pDlg, const char **pszDialogResource)
 
static int get_id_val (const char *szVal, int iLen)
 

Variables

static DIALOG_WINDOWpDialogs = NULL
 
static XColor clrFG
 
static XColor clrBG
 
static XColor clrBD
 
static int iInitColorFlag = 0
 
static const char *const aszKeywords []
 
static const char *const aszSymbols [] ={ "IDOK", "IDCANCEL", "IDYES", "IDNO", "IDRETRY", "IDABORT", "IDIGNORE", "IDSTATIC", "IDNONE", NULL }
 
static const int iIDSymbols [] ={ IDOK, IDCANCEL, IDYES, IDNO, IDRETRY, IDABORT, IDIGNORE, IDSTATIC, IDNONE, -1 }
 

Detailed Description

Implementation for dialog (frame) window and intercommunication structures and APIs.

Definition in file dialog_window.c.

Variable Documentation

◆ aszKeywords

const char* const aszKeywords[]
static
Initial value:
={ "BEGIN_DIALOG","END_DIALOG","FONT","CONTROL","ID",
"X","Y","WIDTH","HEIGHT","VISIBLE","INVISIBLE","TITLE",
"VALIGN_DIALOG_BOTTOM","VALIGN_DIALOG_TOP","VALIGN_DIALOG_CENTER",
"HALIGN_DIALOG_LEFT","HALIGN_DIALOG_RIGHT","HALIGN_DIALOG_CENTER",
"VRESIZE","HRESIZE","BORDER","NOBORDER","CLICKABLE",
"CHECKED","ENABLED","DISABLED",
"VALIGN_TEXT_TOP","VALIGN_TEXT_BOTTOM","VALIGN_TEXT_CENTER",
"HALIGN_TEXT_LEFT","HALIGN_TEXT_RIGHT","HALIGN_TEXT_CENTER",
NULL }

Definition at line 1785 of file dialog_window.c.