X11workbench Toolkit  1.0
dialog_controls.c File Reference
#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 <sys/stat.h>
#include <X11/keysymdef.h>
#include <X11/cursorfont.h>
#include "window_helper.h"
#include "pixmap_helper.h"
#include "dialog_window.h"
#include "dialog_controls.h"
#include "dialog_support.h"
#include "conf_help.h"
#include "text_object.h"
#include "file_help.h"
#include "draw_text.h"
#include "window_dressing.h"

Go to the source code of this file.

Macros

#define XK_MISCELLANY   /* mostly for interix */
 
#define THIS_SUBSYSTEM   DebugSubSystem_DialogCtrl
 
#define KEYSYM_DEBUG_FLAG   DebugLevel_Excessive/*DebugLevel_ERROR*/
 
#define DEFAULT_STATIC_TAB_WIDTH   4 /* for drawing static text */
 
#define DEFAULT_BUTTON_TAB_WIDTH   4 /* for drawing button text */
 
#define DEFINE_CREATE_CONTROL(X)
 
#define IMPLEMENT_CREATE_CONTROL(X)
 
#define BEGIN_CREATE_CONTROL(X)   Atom aThis WB_UNUSED = a##X;
 
#define DO_CREATE_CONTROL(X)
 
#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));}
 
#define LOAD_COLOR0(X, Y)   if(CHGetResourceString(WBGetDefaultDisplay(), X, Y, sizeof(Y)) > 0) { }
 
#define LOAD_COLOR(X, Y, Z)   if(CHGetResourceString(WBGetDefaultDisplay(), X, Y, sizeof(Y)) <= 0){ WB_WARN_PRINT("%s - WARNING: can't find color %s, using default value %s\n", __FUNCTION__, X, Z); strcpy(Y,Z); }
 
#define KEYSYM_MATCH_CURSOR_NAME(X)   (iKey == XK_##X || iKey == XK_KP_##X)
 
#define KEYSYM_MATCH_CURSOR_NAME(X)   (iKey == XK_##X || iKey == XK_KP_##X)
 

Functions

static void FileListControlDisplayProc (WBDialogControl *pList, void *pData, int iSelected, WBGC gc, WB_GEOM *pGeom, WB_FONTC pFont)
 
static int GetWBDialogControlStructSize (Atom aClass)
 
int DLGControlDefaultCallback (Window wID, XEvent *pEvent)
 
void DLGRegisterControlCallback (WBDialogControl *pDialogControl, const char *szClassName, WBWinEvent pCallback)
 Register the dialog control's callback function and class name. More...
 
WBDialogControlWBDialogControlCreate (Atom aClass, WBDialogWindow *pOwner, WBDialogEntry *pDialogEntry, int iX, int iY, int iWidth, int iHeight, const char *szTitle, const char *szPropertyList)
 Create a dialog control window. More...
 
static void alloc_control_colors (WBDialogControl *pDialogControl, int bUseStaticColors)
 
static void old_alloc_control_colors (WBDialogControl *pDialogControl, const char *szFGName, const char *szBGName, const char *szHFGName, const char *szHBGName, const char *szAFGName, const char *szABGName, const char *szBDName, int bUseStaticColors)
 
static Display * dialog_control_get_display (WBDialogControl *pDialogControl)
 
static Window standard_do_create_control (WBDialogControl *pDialogControl, int iX, int iY, int iWidth, int iHeight, int iBorderWidth, const char *szClassName, const char *szTitle, WBWinEvent pCallback)
 
static int static_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (FRAME_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (TEXT_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (ICON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (IMAGE_CONTROL)
 
static int edit_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (EDIT_CONTROL)
 
static int button_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (PUSHBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (DEFPUSHBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (CANCELBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (RADIOBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (FIRSTRADIOBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (CHECKBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (TRISTATEBUTTON_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (HSCROLL_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (VSCROLL_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (SLIDER_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (KNOB_CONTROL)
 
static int list_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (LIST_CONTROL)
 
static int combo_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (COMBO_CONTROL)
 
static int tree_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (TREE_CONTROL)
 
static int combo_tree_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (COMBOTREE_CONTROL)
 
static int file_list_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (FILE_LIST_CONTROL)
 
static int file_combo_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (FILE_COMBO_CONTROL)
 
static int path_tree_callback (Window wID, XEvent *pEvent)
 
 IMPLEMENT_CREATE_CONTROL (PATH_TREE_CONTROL)
 
 IMPLEMENT_CREATE_CONTROL (TAB_CONTROL)
 
static int StaticDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int EditDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int EditDoCharEvent (XClientMessageEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int EditDoPointerEvent (XClientMessageEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int PushButtonDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int ButtonDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static void ManageRadioButtonGroupSelectState (WBDialogControl *pDialogControl)
 
static int ButtonHandleCheckEvent (Display *pDisplay, Window wID, WBDialogControl *pDialogControl, int iType, int iCheck)
 
static int ListDoExposeEvent (XExposeEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int ListDoCharEvent (XClientMessageEvent *pEvent, Display *pDisplay, Window wID, WBDialogControl *pSelf)
 
static int ListGetItemIndexFromXY (LISTINFO *pListInfo, int iX, int iY)
 
static void ListInvalidateItemRect (Window wID, LISTINFO *pListInfo, int iIndex)
 

Detailed Description

Dialog Control support, standard control implementation

Definition in file dialog_controls.c.

Macro Definition Documentation

◆ DEFINE_CREATE_CONTROL

#define DEFINE_CREATE_CONTROL (   X)
Value:
static WBDialogControl * do_create_##X(WBDialogControl *pDialogControl, \
int iX, int iY, int iWidth, int iHeight, \
const char *szClassName, const char *szTitle);
Structure identifying the properties of a dialog box control.

Definition at line 94 of file dialog_controls.c.

◆ DO_CREATE_CONTROL

#define DO_CREATE_CONTROL (   X)
Value:
if(aClass == a##X) \
{ return do_create_##X(pRval, iX, iY, iWidth, iHeight, #X, szTitle); }

◆ IMPLEMENT_CREATE_CONTROL

#define IMPLEMENT_CREATE_CONTROL (   X)
Value:
static WBDialogControl * do_create_##X(WBDialogControl *pDialogControl, \
int iX, int iY, int iWidth, int iHeight, \
const char *szClassName, const char *szTitle)
Structure identifying the properties of a dialog box control.

Definition at line 99 of file dialog_controls.c.