Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
dlgtstr.cpp File Reference
#include <os2.h>
#include "xp.h"
#include "resource.h"
#include "plugin.h"
#include "logger.h"

Go to the source code of this file.

Defines

#define INCL_WIN

Functions

static void onCommand (HWND hWnd, int id, HWND hWndCtl, USHORT codeNotify)
MRESULT EXPENTRY NP_LOADDS ManualDlgProc (HWND, ULONG, MPARAM, MPARAM)
MRESULT EXPENTRY NP_LOADDS AutoDlgProc (HWND, ULONG, MPARAM, MPARAM)
static BOOL onInitDialog (HWND hWnd, HWND hWndFocus, MPARAM lParam)
static void onDestroy (HWND hWnd)
MRESULT EXPENTRY NP_LOADDS TesterDlgProc (HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)

Variables

CLoggerpLogger

Define Documentation

Definition at line 39 of file dlgtstr.cpp.


Function Documentation

MRESULT EXPENTRY NP_LOADDS AutoDlgProc ( HWND  ,
ULONG  ,
MPARAM  ,
MPARAM   
)

Definition at line 225 of file dlgauto.cpp.

{
  switch(msg)
  {
    case WM_INITDLG:
      onInitDialog(hWnd, 0, mp2);
      return (MRESULT)FALSE;
    case WM_COMMAND:
    case WM_CONTROL:
      onCommand(hWnd, SHORT1FROMMP(mp1), 0, SHORT2FROMMP(mp1));
      break;
    case WM_DESTROY:
      onDestroy(hWnd);
      break;

    default:
      return WinDefDlgProc(hWnd, msg, mp1, mp2);
  }
  return (MRESULT)TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY NP_LOADDS ManualDlgProc ( HWND  ,
ULONG  ,
MPARAM  ,
MPARAM   
)

Definition at line 217 of file dlgman.cpp.

{
  switch(msg)
  {
    case WM_INITDLG:
      onInitDialog(hWnd, 0, mp2);
      return (MRESULT) FALSE;
    case WM_COMMAND:
    case WM_CONTROL:
      onCommand(hWnd, SHORT1FROMMP(mp1), WinWindowFromID(hWnd, SHORT1FROMMP(mp1)), SHORT2FROMMP(mp1));
      break;
    case WM_DESTROY:
      onDestroy(hWnd);
      break;

    default:
      return WinDefDlgProc(hWnd, msg, mp1, mp2);
  }
  return (MRESULT)TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void onCommand ( HWND  hWnd,
int  id,
HWND  hWndCtl,
USHORT  codeNotify 
) [static]

Definition at line 50 of file dlgtstr.cpp.

{
  CPlugin * pPlugin = (CPlugin *)WinQueryWindowULong(hWnd, QWL_USER);
  if(!pPlugin)
    return;

  switch (id)
  {
    case IDC_RADIO_MODE_MANUAL:
      if((codeNotify == BN_CLICKED) && (WinQueryButtonCheckstate(hWnd, IDC_RADIO_MODE_MANUAL) == BST_CHECKED))
      {
        pPlugin->showGUI(sg_manual);
        pPlugin->updatePrefs(gp_mode, sg_manual);
      }
      break;
    case IDC_EDIT_LOG_FILE_NAME:
      if(codeNotify == EN_CHANGE)
      {
        char szString[256];
        WinQueryWindowText(WinWindowFromID(hWnd, IDC_EDIT_LOG_FILE_NAME), sizeof(szString), szString);
        pPlugin->updatePrefs(gp_logfile, FALSE, szString);
      }
    case IDC_RADIO_MODE_AUTO:
      if((codeNotify == BN_CLICKED) && (WinQueryButtonCheckstate(hWnd, IDC_RADIO_MODE_AUTO) == BST_CHECKED))
      {
        pPlugin->showGUI(sg_auto);
        pPlugin->updatePrefs(gp_mode, sg_auto);
      }
      break;
    case IDC_BUTTON_FLUSH:
      pLogger->clearTarget();
      pLogger->dumpLogToTarget();
      break;
    case IDC_BUTTON_CLEAR:
      pLogger->clearTarget();
      pLogger->clearLog();
      break;
      break;
    case IDC_CHECK_LOG_TO_FILE:
      if(codeNotify == BN_CLICKED)
      {
        pPlugin->updatePrefs(gp_tofile, BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FILE));
        WinEnableWindow(WinWindowFromID(hWnd, IDC_EDIT_LOG_FILE_NAME), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FILE)));
        pPlugin->onLogToFile(BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FILE));
      }
      break;
    case IDC_CHECK_LOG_TO_FRAME:
      if(codeNotify == BN_CLICKED)
      {
        pPlugin->updatePrefs(gp_toframe, BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME));
        WinEnableWindow(WinWindowFromID(hWnd, IDC_BUTTON_FLUSH), (BST_UNCHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_SHOW_LOG))
                                                        && (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));
        WinEnableWindow(WinWindowFromID(hWnd, IDC_BUTTON_CLEAR), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));
        WinEnableWindow(WinWindowFromID(hWnd, IDC_CHECK_SHOW_LOG), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));
        pLogger->setLogToFrameFlag(BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME));
      }
      break;
    case IDC_CHECK_SHOW_LOG:
      if(codeNotify == BN_CLICKED)
      {
        pPlugin->updatePrefs(gp_flush, WinQueryButtonCheckstate(hWnd, IDC_CHECK_SHOW_LOG) == BST_CHECKED);
        WinEnableWindow(WinWindowFromID(hWnd, IDC_BUTTON_FLUSH), (BST_UNCHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_SHOW_LOG))
                                                        && (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));
        pLogger->setShowImmediatelyFlag(WinQueryButtonCheckstate(hWnd, IDC_CHECK_SHOW_LOG) == BST_CHECKED);
      }
      break;
    case IDC_CHECK_REMEMBER_LAST:
      if(codeNotify == BN_CLICKED)
        pPlugin->updatePrefs(gp_rememberlast, WinQueryButtonCheckstate(hWnd, IDC_CHECK_REMEMBER_LAST) == BST_CHECKED);
      break;
    default:
      break;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void onDestroy ( HWND  hWnd) [static]

Definition at line 164 of file dlgtstr.cpp.

{
  CPlugin * pPlugin = (CPlugin *)WinQueryWindowULong(hWnd, QWL_USER);
  pPlugin->onDestroy();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL onInitDialog ( HWND  hWnd,
HWND  hWndFocus,
MPARAM  lParam 
) [static]

Definition at line 128 of file dlgtstr.cpp.

{
  CPlugin * pPlugin = (CPlugin *)lParam;

  WinSetWindowULong(hWnd, QWL_USER, (ULONG)pPlugin);

  WinSetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_SHOW ); 

  HMODULE hInst = pPlugin->getInstance();
  HWND hWndManual = WinLoadDlg(hWnd, hWnd, (PFNWP)ManualDlgProc, hInst, IDD_DIALOG_MANUAL, (PVOID)pPlugin);
  HWND hWndAuto = WinLoadDlg(hWnd, hWnd, (PFNWP)AutoDlgProc, hInst, IDD_DIALOG_AUTO, (PVOID)pPlugin);

  WinCheckButton(hWnd, (pPlugin->m_Pref_ShowGUI == sg_manual) ? IDC_RADIO_MODE_MANUAL : IDC_RADIO_MODE_AUTO, BST_CHECKED);

  WinSetWindowText(WinWindowFromID(hWnd, IDC_EDIT_LOG_FILE_NAME), pPlugin->m_Pref_szLogFile);

  WinCheckButton(hWnd, IDC_CHECK_LOG_TO_FILE, (pPlugin->m_Pref_bToFile) ? BST_CHECKED : BST_UNCHECKED);
  WinEnableWindow(WinWindowFromID(hWnd, IDC_EDIT_LOG_FILE_NAME), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FILE)));

  WinCheckButton(hWnd, IDC_CHECK_LOG_TO_FRAME, (pPlugin->m_Pref_bToFrame) ? BST_CHECKED : BST_UNCHECKED);
  WinEnableWindow(WinWindowFromID(hWnd, IDC_BUTTON_CLEAR), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));
  WinEnableWindow(WinWindowFromID(hWnd, IDC_CHECK_SHOW_LOG), (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));

  WinCheckButton(hWnd, IDC_CHECK_SHOW_LOG, (pPlugin->m_Pref_bFlushNow) ? BST_CHECKED : BST_UNCHECKED);
  WinCheckButton(hWnd, IDC_CHECK_REMEMBER_LAST, (pPlugin->m_Pref_bRememberLastCall) ? BST_CHECKED : BST_UNCHECKED);

  WinEnableWindow(WinWindowFromID(hWnd, IDC_BUTTON_FLUSH), (BST_UNCHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_SHOW_LOG))
                                                  && (BST_CHECKED == WinQueryButtonCheckstate(hWnd, IDC_CHECK_LOG_TO_FRAME)));

  pPlugin->onInit(hWnd, hWndManual, hWndAuto);

  pPlugin->showGUI(pPlugin->m_Pref_ShowGUI);

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

MRESULT EXPENTRY NP_LOADDS TesterDlgProc ( HWND  hWnd,
ULONG  msg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 170 of file dlgtstr.cpp.

{
  switch(msg)
  {
    case WM_INITDLG:
      onInitDialog(hWnd, 0, mp2);
      return (MRESULT) FALSE;
    case WM_COMMAND:
    case WM_CONTROL:
      onCommand(hWnd, SHORT1FROMMP(mp1), 0, SHORT2FROMMP(mp1));
      break;
    case WM_DESTROY:
      onDestroy(hWnd);
      break;

    default:
      return WinDefDlgProc(hWnd, msg, mp1, mp2);
  }
  return (MRESULT)TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 47 of file np_entry.cpp.