Compare commits
64 Commits
ServMgrCha
...
MODULAR_NE
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c515100b8e | ||
|
|
fe0f4d855f | ||
|
|
3d4019f9c4 | ||
|
|
9d96048a4b | ||
|
|
ae5d3bac86 | ||
|
|
dd5a8c0dfa | ||
|
|
a5f43d2a13 | ||
|
|
897d60bb73 | ||
|
|
fd1359cac8 | ||
|
|
aa88ba7591 | ||
|
|
0c9f6e6d80 | ||
|
|
f635646933 | ||
|
|
74a41b1364 | ||
|
|
dddf36e52d | ||
|
|
42f1218f94 | ||
|
|
9369584965 | ||
|
|
644d7cd9c7 | ||
|
|
cac7b720c3 | ||
|
|
371d44de72 | ||
|
|
d5840939c7 | ||
|
|
2a50f93567 | ||
|
|
d2a75afae6 | ||
|
|
8f2a603835 | ||
|
|
d9babead55 | ||
|
|
daa26a48be | ||
|
|
be77d90b49 | ||
|
|
e2793376a7 | ||
|
|
6d54e5f6e3 | ||
|
|
b0db9a4acd | ||
|
|
a7a9a03946 | ||
|
|
5340ef2b1b | ||
|
|
1043bb4cc9 | ||
|
|
9cb908ce37 | ||
|
|
93cf7025ed | ||
|
|
42b35681a2 | ||
|
|
bd2471c41c | ||
|
|
3231691800 | ||
|
|
2bdd74e814 | ||
|
|
97b4b7a6d1 | ||
|
|
55369bada1 | ||
|
|
82ed1f72bb | ||
|
|
52d02fe072 | ||
|
|
11e91b2751 | ||
|
|
9c6ac35617 | ||
|
|
50054acba1 | ||
|
|
79a4c9490b | ||
|
|
c181b6d7f9 | ||
|
|
a5e5b98ad8 | ||
|
|
f453d81444 | ||
|
|
05cb725cfb | ||
|
|
46d5611628 | ||
|
|
d9a5e647f5 | ||
|
|
6c07a2ca66 | ||
|
|
3c5574eb6e | ||
|
|
fee6fe5171 | ||
|
|
46e818474a | ||
|
|
ac3fe4623e | ||
|
|
e5430a78e1 | ||
|
|
e8ecd3ec68 | ||
|
|
86e542aa90 | ||
|
|
35f45baaed | ||
|
|
e72757dc16 | ||
|
|
f7ac2222ef | ||
|
|
4099eb2ef3 |
3875
mozilla/cmd/winfe/fegui.cpp
Executable file
3875
mozilla/cmd/winfe/fegui.cpp
Executable file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,898 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
// npwplat.cpp
|
||||
#include "stdafx.h"
|
||||
#include <afxole.h>
|
||||
#include <afxpriv.h>
|
||||
#include <afxwin.h>
|
||||
#include <errno.h>
|
||||
#include <direct.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#ifdef WIN32
|
||||
#include <io.h>
|
||||
#include <winver.h>
|
||||
#else
|
||||
#include <dos.h>
|
||||
#include <ver.h>
|
||||
#endif
|
||||
#include "npwplat.h"
|
||||
#include "nppg.h"
|
||||
#include "plgindll.h"
|
||||
#include "np.h"
|
||||
#include "helper.h"
|
||||
#if defined(OJI)
|
||||
#include "jvmmgr.h"
|
||||
#elif defined(JAVA)
|
||||
#include "java.h"
|
||||
#endif
|
||||
#include "edt.h"
|
||||
#include "npglue.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
NPPMgtBlk* g_pRegisteredPluginList = NULL;
|
||||
|
||||
// Tests that the directory specified by "dir" exists.
|
||||
// Returns true if it does.
|
||||
|
||||
static XP_Bool wfe_CheckDir(const char * dir)
|
||||
{
|
||||
int ret;
|
||||
XP_StatStruct statinfo;
|
||||
|
||||
ret = _stat((char *) dir, &statinfo);
|
||||
if(ret == -1)
|
||||
return(FALSE);
|
||||
|
||||
return(TRUE);
|
||||
|
||||
}
|
||||
|
||||
// Get the name of the directory where plugins live. "csDirname" is where the
|
||||
// name of the dir is written to, and the trailing slash is removed.
|
||||
// It always returns NPERR_NO_ERROR, since the Nav had to be started to get
|
||||
// here, and the plugin dir is under where Nav started from.
|
||||
NPError wfe_GetPluginsDirectory(CString& csDirname)
|
||||
{
|
||||
char ca_default[_MAX_PATH];
|
||||
::GetModuleFileName(AfxGetApp()->m_hInstance, ca_default, _MAX_PATH);
|
||||
char *cp_lastslash = ::strrchr(ca_default, '\\');
|
||||
*cp_lastslash = NULL;
|
||||
csDirname = ca_default;
|
||||
csDirname += "\\plugins";
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
NPError wfe_GetJavaDirectory(CString& csDirname)
|
||||
{
|
||||
char ca_default[_MAX_PATH];
|
||||
::GetModuleFileName(AfxGetApp()->m_hInstance, ca_default, _MAX_PATH);
|
||||
char *cp_lastslash = ::strrchr(ca_default, '\\');
|
||||
*cp_lastslash = NULL;
|
||||
csDirname = ca_default;
|
||||
csDirname += "\\java\\classes";
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Fetches the "MIME type" string from the DLL VERSIONINFO structure.
|
||||
// "pVersionInfo" is ptr to the VERSIONINFO data, and "pNPMgtBlk" is a handle
|
||||
// to a plugin management data structure created during fe_RegisterPlugin().
|
||||
// The string is copied from the VERSIONINFO data into the
|
||||
// "pNPMgtBlk->szMIMEType" member.
|
||||
// An error is returned if out of memory. The MIME type string IS
|
||||
// required, so an error is returned if the string does not exist.
|
||||
NPError wfe_GetPluginMIMEType(VS_FIXEDFILEINFO* pVersionInfo,
|
||||
NPPMgtBlk* pNPMgtBlk)
|
||||
{
|
||||
// get the mime type of this plugin
|
||||
static char szMimeTypeBlock[] = "StringFileInfo\\040904E4\\MIMEType";
|
||||
void* lpBuffer = NULL;
|
||||
UINT uValueSize = 0;
|
||||
if(::VerQueryValue(pVersionInfo, szMimeTypeBlock,
|
||||
&lpBuffer, &uValueSize) == 0) // couldn't find MIME type
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
||||
pNPMgtBlk->szMIMEType = new char[uValueSize];
|
||||
if(pNPMgtBlk->szMIMEType == NULL)
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
|
||||
strcpy(pNPMgtBlk->szMIMEType, (const char*)lpBuffer);
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Fetches the "File Extents" string from the DLL VERSIONINFO structure.
|
||||
// "pVersionInfo" is ptr to the VERSIONINFO data, and "pNPMgtBlk" is a handle
|
||||
// to a plugin management data structure created during fe_RegisterPlugin().
|
||||
// The string is copied from the VERSIONINFO data into the
|
||||
// "pNPMgtBlk->szFileExtents" member.
|
||||
// An error is returned if out of memory, but the extents string is not
|
||||
// required, so it is not an error if the string does not exist.
|
||||
NPError wfe_GetPluginExtents(VS_FIXEDFILEINFO* pVersionInfo,
|
||||
NPPMgtBlk* pNPMgtBlk)
|
||||
{ // get the file extent list of this plugin
|
||||
pNPMgtBlk->szFileExtents = NULL;
|
||||
|
||||
static char szFileExtentsBlock[] = "StringFileInfo\\040904E4\\FileExtents";
|
||||
void* lpBuffer = NULL;
|
||||
UINT uValueSize = 0;
|
||||
|
||||
if(::VerQueryValue(pVersionInfo, szFileExtentsBlock,
|
||||
&lpBuffer, &uValueSize) == 0)
|
||||
// couldn't find file extent
|
||||
return NPERR_NO_ERROR;
|
||||
|
||||
if((*((char*)lpBuffer) == '\0') || (uValueSize == 0)) // no extents
|
||||
return NPERR_NO_ERROR;
|
||||
|
||||
// alloc char array
|
||||
pNPMgtBlk->szFileExtents = new char[uValueSize];
|
||||
if(pNPMgtBlk->szFileExtents == NULL)
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
strcpy(pNPMgtBlk->szFileExtents, (const char*)lpBuffer);
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Fetches the "File Open Template" string from the DLL VERSIONINFO structure.
|
||||
// "pVersionInfo" is ptr to the VERSIONINFO data, and "pNPMgtBlk" is a handle
|
||||
// to a plugin management data structure created during fe_RegisterPlugin().
|
||||
// The string is copied from the VERSIONINFO data into the
|
||||
// "pNPMgtBlk->szFileOpenName" member.
|
||||
// An error is returned if out of memory, but the template string is not
|
||||
// required, so it is not an error if the string does not exist.
|
||||
NPError wfe_GetPluginFileOpenTemplate(VS_FIXEDFILEINFO* pVersionInfo,
|
||||
NPPMgtBlk* pNPMgtBlk)
|
||||
{ // get the file open template this plugin
|
||||
pNPMgtBlk->szFileOpenName = NULL;
|
||||
|
||||
static char szFileOpenBlock[] = "StringFileInfo\\040904E4\\FileOpenName";
|
||||
void* lpBuffer = NULL;
|
||||
UINT uValueSize = 0;
|
||||
|
||||
if(::VerQueryValue(pVersionInfo, szFileOpenBlock,
|
||||
&lpBuffer, &uValueSize) == 0)
|
||||
// couldn't find file extent
|
||||
return NPERR_NO_ERROR;
|
||||
|
||||
if((*((char*)lpBuffer) == '\0') || (uValueSize == 0)) // no extents
|
||||
return NPERR_NO_ERROR;
|
||||
|
||||
// alloc char array
|
||||
pNPMgtBlk->szFileOpenName = new char[uValueSize];
|
||||
if(pNPMgtBlk->szFileOpenName == NULL)
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
strcpy(pNPMgtBlk->szFileOpenName, (const char*)lpBuffer);
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Fetches the plugin name and description from the resource info.
|
||||
// Uses predefined version information strings
|
||||
NPError wfe_GetPluginNameAndDescription(VS_FIXEDFILEINFO* pVersionInfo,
|
||||
CString& strName,
|
||||
CString& strDescription)
|
||||
{
|
||||
static char szNameBlock[] = "StringFileInfo\\040904E4\\ProductName";
|
||||
static char szDescBlock[] = "StringFileInfo\\040904E4\\FileDescription";
|
||||
void* lpBuffer = NULL;
|
||||
UINT uValueSize = 0;
|
||||
|
||||
// Get the product name
|
||||
if(::VerQueryValue(pVersionInfo, szNameBlock, &lpBuffer, &uValueSize) > 0)
|
||||
strName = (LPSTR)lpBuffer;
|
||||
|
||||
// Get the file description
|
||||
if(::VerQueryValue(pVersionInfo, szDescBlock, &lpBuffer, &uValueSize) > 0)
|
||||
strDescription = (LPSTR)lpBuffer;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Loads plugin properties from the DLL VERSIONINFO data structure.
|
||||
// MIME type and version are required, but file extents and string
|
||||
// file open templates are optional. "pPluginFilespec" is a string
|
||||
// containing the file name of a DLL. "pNPMgtBlk" is a handle to a
|
||||
// plugin management data structure created during fe_RegisterPlugin().
|
||||
// Returns an error if "pPluginFilespec" did not have the required MIME
|
||||
// type and version fields.
|
||||
//
|
||||
// Also returns the plugin name and description
|
||||
NPError wfe_GetPluginProperties(char* pPluginFilespec,
|
||||
NPPMgtBlk* pNPMgtBlk,
|
||||
CString& strPluginName,
|
||||
CString& strPluginDescription)
|
||||
{
|
||||
// prepare to read the version info tags
|
||||
DWORD dwHandle = NULL;
|
||||
DWORD dwVerInfoSize = ::GetFileVersionInfoSize(pPluginFilespec, &dwHandle);
|
||||
if(dwVerInfoSize == NULL)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
||||
VS_FIXEDFILEINFO* pVersionInfo =
|
||||
(VS_FIXEDFILEINFO*)new char[dwVerInfoSize];
|
||||
if(pVersionInfo == NULL)
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
|
||||
if(::GetFileVersionInfo(pPluginFilespec, dwHandle,
|
||||
dwVerInfoSize, pVersionInfo) == 0)
|
||||
{
|
||||
delete [] (char*)pVersionInfo;
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
NPError result;
|
||||
// get the mime type of this plugin
|
||||
if((result = wfe_GetPluginMIMEType(pVersionInfo, pNPMgtBlk))
|
||||
!= NPERR_NO_ERROR)
|
||||
{
|
||||
delete [] (char*)pVersionInfo;
|
||||
return result;
|
||||
}
|
||||
|
||||
// get the file extent list of this plugin
|
||||
if((result = wfe_GetPluginExtents(pVersionInfo, pNPMgtBlk))
|
||||
!= NPERR_NO_ERROR)
|
||||
|
||||
{
|
||||
delete [] pNPMgtBlk->szMIMEType;
|
||||
delete [] (char*)pVersionInfo;
|
||||
return result;
|
||||
}
|
||||
|
||||
// get the file type template string of this plugin
|
||||
if((result = wfe_GetPluginFileOpenTemplate(pVersionInfo, pNPMgtBlk))
|
||||
!= NPERR_NO_ERROR)
|
||||
|
||||
{
|
||||
delete [] pNPMgtBlk->szFileExtents;
|
||||
delete [] pNPMgtBlk->szMIMEType;
|
||||
delete [] (char*)pVersionInfo;
|
||||
return result;
|
||||
}
|
||||
|
||||
// get the version of this plugin
|
||||
void* lpBuffer = NULL;
|
||||
UINT uValueSize = 0;
|
||||
if(::VerQueryValue(pVersionInfo, "\\", &lpBuffer, &uValueSize) == 0)
|
||||
{ // couldn't find versioninfo
|
||||
delete [] pNPMgtBlk->szFileExtents;
|
||||
delete [] pNPMgtBlk->szMIMEType;
|
||||
delete [] (char*)pVersionInfo;
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
pNPMgtBlk->versionMS = ((VS_FIXEDFILEINFO*)lpBuffer)->dwProductVersionMS;
|
||||
pNPMgtBlk->versionLS = ((VS_FIXEDFILEINFO*)lpBuffer)->dwProductVersionLS;
|
||||
|
||||
// get the plugin name and description. It's not fatal if these fail
|
||||
wfe_GetPluginNameAndDescription(pVersionInfo, strPluginName, strPluginDescription);
|
||||
|
||||
delete [] (char*)pVersionInfo;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// Given a file open filter, e.g. Text Documents(*.txt), extracts the
|
||||
// description and returns a copy of it
|
||||
static LPSTR
|
||||
ExtractDescription(LPCSTR lpszFileOpenFilter)
|
||||
{
|
||||
ASSERT(lpszFileOpenFilter);
|
||||
|
||||
LPSTR lpszDescription = XP_STRDUP(lpszFileOpenFilter);
|
||||
|
||||
// Strip off an filter pattern at the end
|
||||
LPSTR lpszPattern = strrchr(lpszDescription, '(');
|
||||
|
||||
if (lpszPattern)
|
||||
*lpszPattern = '\0';
|
||||
|
||||
return lpszDescription;
|
||||
}
|
||||
|
||||
// Registers one plugin. "pPluginFilespec" is a string containing the file
|
||||
// name of a DLL.
|
||||
// This function can be called more than once so a plugin which has copied
|
||||
// into the plugins subdir AFTER the Nav has started can be registered
|
||||
// and loaded.
|
||||
// The DLL is a plugin candidate, and is qualified during
|
||||
// this function, by checking the DLL VERSIONINFO data structure for a
|
||||
// MIME type string. If this string is found successfully, the handle
|
||||
// of the management block is used to register the plugin for its MIME type.
|
||||
// The extents which are to be associated with this MIME type are also grokked
|
||||
// from the VERSIONINFO data structure, once the candidate is accepted.
|
||||
// This function also takes the opportunity to overrided any helper app, by
|
||||
// setting a helper app data structure member to allow the plugin to handle
|
||||
// the MIME type instead of the helper, (pApp->how_handle = HANDLE_VIA_PLUGIN).
|
||||
// Returns an error if "pPluginFilespec" was not registered.
|
||||
NPError fe_RegisterPlugin(char* pPluginFilespec)
|
||||
{
|
||||
CString strName, strDescription;
|
||||
|
||||
// initialize a new plugin list mgt block
|
||||
NPPMgtBlk* pNPMgtBlk = new NPPMgtBlk;
|
||||
if(pNPMgtBlk == NULL) // fatal, can't continue
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
|
||||
pNPMgtBlk->pPluginFuncs = NULL;
|
||||
pNPMgtBlk->pLibrary = NULL;
|
||||
pNPMgtBlk->uRefCount = 0;
|
||||
pNPMgtBlk->next = NULL;
|
||||
|
||||
// determine the MIME type and version of this plugin
|
||||
if(wfe_GetPluginProperties(pPluginFilespec, pNPMgtBlk, strName, strDescription) != NPERR_NO_ERROR)
|
||||
{
|
||||
delete pNPMgtBlk;
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
|
||||
// if a plugin is already registered for this MIME type, return. this
|
||||
// allows downloading and registering new plugins without exiting the nav
|
||||
for(NPPMgtBlk* pListBlk = g_pRegisteredPluginList; pListBlk != NULL;
|
||||
pListBlk = pListBlk->next) {
|
||||
BOOL bSameFile =
|
||||
(strcmp(pListBlk->pPluginFilename, pPluginFilespec) == 0);
|
||||
BOOL bSameMIMEtype =
|
||||
(strstr(pNPMgtBlk->szMIMEType, pListBlk->szMIMEType) != NULL);
|
||||
if(bSameFile && bSameMIMEtype) {
|
||||
// the plugin DLL's filename and the MIME type it's registering for
|
||||
// are the same, don't reregister
|
||||
delete pNPMgtBlk;
|
||||
return NPERR_GENERIC_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pNPMgtBlk->pPluginFilename = XP_STRDUP(pPluginFilespec);
|
||||
if(pNPMgtBlk->pPluginFilename == NULL) // fatal, can't continue
|
||||
{
|
||||
delete pNPMgtBlk;
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
}
|
||||
|
||||
// Register the plugin file with the XP plugin code
|
||||
NPL_RegisterPluginFile(strName, pNPMgtBlk->pPluginFilename, strDescription,
|
||||
pNPMgtBlk);
|
||||
|
||||
// Iterate through the filename extensions. These are a list which are
|
||||
// delimited via the '|' character. The list of MIME Types,File Extents,
|
||||
// and Open Names must all coordinate
|
||||
char *pStartMIME, *pEndMIME, *pStartExt, *pEndExt, *pStartName, *pEndName;
|
||||
|
||||
pStartMIME = pNPMgtBlk->szMIMEType;
|
||||
pStartExt = pNPMgtBlk->szFileExtents;
|
||||
pStartName = pNPMgtBlk->szFileOpenName;
|
||||
|
||||
pEndMIME = strchr(pStartMIME ,'|');
|
||||
while (pEndMIME) {
|
||||
pEndExt = strchr(pStartExt,'|');
|
||||
pEndName = strchr(pStartName,'|');
|
||||
if (pEndMIME) *pEndMIME = 0;
|
||||
else return NPERR_GENERIC_ERROR;
|
||||
if (pEndExt) *pEndExt = 0;
|
||||
else return NPERR_GENERIC_ERROR;
|
||||
if (pEndName) *pEndName = 0;
|
||||
else return NPERR_GENERIC_ERROR;
|
||||
|
||||
// Register the MIME type with the XP plugin code. We need to pass in
|
||||
// a description. If there's a file open template specified, then use the
|
||||
// description from there. Otherwise use the MIME type
|
||||
LPSTR lpszDescription = NULL;
|
||||
|
||||
if (pStartName)
|
||||
lpszDescription = ExtractDescription(pStartName);
|
||||
|
||||
NPL_RegisterPluginType(pStartMIME, (LPCSTR)pStartExt, lpszDescription ?
|
||||
lpszDescription : pStartMIME, (void *)pStartName, pNPMgtBlk, TRUE);
|
||||
|
||||
if (lpszDescription)
|
||||
XP_FREE(lpszDescription);
|
||||
|
||||
CHelperApp *pApp;
|
||||
if(theApp.m_HelperListByType.Lookup(pStartMIME, (CObject *&)pApp)) {
|
||||
// We've a match.
|
||||
// Make sure the app is marked to handle the load
|
||||
// via a plugin
|
||||
pApp->how_handle = HANDLE_VIA_PLUGIN;
|
||||
}
|
||||
|
||||
if ((pEndMIME+1) && (pEndExt+1) && (pEndName+1)) {
|
||||
pStartMIME = pEndMIME+1;
|
||||
pStartExt = pEndExt+1;
|
||||
pStartName = pEndName+1;
|
||||
}
|
||||
pEndMIME = strchr(pStartMIME ,'|');
|
||||
}
|
||||
|
||||
// Register the MIME type with the XP plugin code. We need to pass in
|
||||
// a description. If there's a file open template specified, then use the
|
||||
// description from there. Otherwise use the MIME type
|
||||
LPSTR lpszDescription = NULL;
|
||||
|
||||
if (pStartName)
|
||||
lpszDescription = ExtractDescription(pStartName);
|
||||
|
||||
NPL_RegisterPluginType(pStartMIME, (LPCSTR)pStartExt, lpszDescription ?
|
||||
lpszDescription : pStartMIME, (void *)pStartName, pNPMgtBlk, TRUE);
|
||||
|
||||
if (lpszDescription)
|
||||
XP_FREE(lpszDescription);
|
||||
|
||||
CHelperApp *pApp;
|
||||
if(theApp.m_HelperListByType.Lookup(pStartMIME, (CObject *&)pApp)) {
|
||||
// We've a match.
|
||||
// Make sure the app is marked to handle the load
|
||||
// via a plugin
|
||||
pApp->how_handle = HANDLE_VIA_PLUGIN;
|
||||
}
|
||||
|
||||
// insert the plugin mgt blk at the head of the list of registered plugins.
|
||||
// this means they are listed in the reverse order from which they were
|
||||
// created, which doesn't matter.
|
||||
pNPMgtBlk->next = g_pRegisteredPluginList;
|
||||
g_pRegisteredPluginList = pNPMgtBlk;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
static NS_DEFINE_IID(kIPluginManagerIID, NS_IPLUGINMANAGER_IID);
|
||||
|
||||
// FE_RegisterPlugins is called from navigator main via npglue's NP_Init(). Finds all
|
||||
// plugins and begins tracking them using a NPPMgtBlk. Uses the NPPMgtBlk
|
||||
// block handle to register the plugin with the xp plugin glue. Looks
|
||||
// in the directory under the netscape.exe dir, named "plugins" and all
|
||||
// subdirectories in recursive way (see fe_RegisterPlugins). If the
|
||||
// directory doesn't exist, no warning dialog is shown.
|
||||
// There are no input or return vals.
|
||||
void fe_RegisterPlugins(char* pszPluginDir)
|
||||
{
|
||||
CString csPluginSpec;
|
||||
csPluginSpec = pszPluginDir;
|
||||
|
||||
#if defined(JAVA)
|
||||
// add directory to the java path no matter what
|
||||
LJ_AddToClassPath(pszPluginDir);
|
||||
#endif
|
||||
|
||||
csPluginSpec += "\\*.*";
|
||||
|
||||
#ifndef _WIN32
|
||||
_find_t fileinfo;
|
||||
unsigned result = _dos_findfirst((LPSTR)((LPCSTR)csPluginSpec), _A_NORMAL | _A_SUBDIR, &fileinfo );
|
||||
|
||||
if (result == 0) {
|
||||
|
||||
result = _dos_findnext(&fileinfo); // skip "."
|
||||
result = _dos_findnext(&fileinfo); // skip ".."
|
||||
|
||||
CString csFileSpec;
|
||||
|
||||
while(result == 0)
|
||||
{
|
||||
csFileSpec = pszPluginDir;
|
||||
csFileSpec += "\\";
|
||||
csFileSpec += fileinfo.name;
|
||||
|
||||
// we got a subdir, call recursively this function to load plugin
|
||||
if (fileinfo.attrib & _A_SUBDIR ) {
|
||||
fe_RegisterPlugins((LPSTR)(LPCSTR)csFileSpec);
|
||||
}
|
||||
else {
|
||||
size_t len = strlen(fileinfo.name);
|
||||
|
||||
// it's a file, see if it can be a plugin file
|
||||
if ( len > 6 && // at least "np.dll"
|
||||
(fileinfo.name[0] == 'n' || fileinfo.name[0] == 'N') &&
|
||||
(fileinfo.name[1] == 'p' || fileinfo.name[1] == 'P') &&
|
||||
!_stricmp(fileinfo.name + len - 4, ".dll"))
|
||||
fe_RegisterPlugin((LPSTR)((LPCSTR)csFileSpec));
|
||||
#ifdef EDITOR
|
||||
// If it's a cpXXX.zip file,register it as a composer plugin.
|
||||
else if ( len > 6 && // at least cp.zip
|
||||
(fileinfo.name[0] == 'c' || fileinfo.name[0] == 'C') &&
|
||||
(fileinfo.name[1] == 'p' || fileinfo.name[1] == 'P') &&
|
||||
(!_stricmp(fileinfo.name + len - 4, ".zip")
|
||||
|| !_stricmp(fileinfo.name + len - 4, ".jar"))
|
||||
)
|
||||
EDT_RegisterPlugin((LPSTR)((LPCSTR)csFileSpec));
|
||||
#endif /* EDITOR */
|
||||
}
|
||||
result = _dos_findnext(&fileinfo);
|
||||
}
|
||||
}
|
||||
#else /* _WIN32 */
|
||||
_finddata_t fileinfo;
|
||||
unsigned handle = _findfirst((LPSTR)((LPCSTR)csPluginSpec), &fileinfo );
|
||||
unsigned result = 0;
|
||||
|
||||
if (handle != -1) {
|
||||
result = _findnext(handle, &fileinfo); // skip "."
|
||||
result = _findnext(handle, &fileinfo); // skip ".."
|
||||
|
||||
|
||||
CString csFileSpec;
|
||||
|
||||
while((result != -1) && (handle != -1))
|
||||
{
|
||||
csFileSpec = pszPluginDir;
|
||||
csFileSpec += "\\";
|
||||
csFileSpec += fileinfo.name;
|
||||
|
||||
// we got a subdir, call recursively this function to load plugin
|
||||
if (fileinfo.attrib & _A_SUBDIR ) {
|
||||
fe_RegisterPlugins((LPSTR)(LPCSTR)csFileSpec);
|
||||
}
|
||||
else {
|
||||
size_t len = strlen(fileinfo.name);
|
||||
|
||||
// it's a file, see if it can be a plugin file
|
||||
if ( len > 6 && // at least "np.dll"
|
||||
(fileinfo.name[0] == 'n' || fileinfo.name[0] == 'N') &&
|
||||
(fileinfo.name[1] == 'p' || fileinfo.name[1] == 'P') &&
|
||||
!_stricmp(fileinfo.name + len - 4, ".dll"))
|
||||
fe_RegisterPlugin((LPSTR)((LPCSTR)csFileSpec));
|
||||
#ifdef EDITOR
|
||||
// If it's a cpXXX.zip file, add it to the java class path.
|
||||
else if ( len > 6 && // at least cp.zip
|
||||
(fileinfo.name[0] == 'c' || fileinfo.name[0] == 'C') &&
|
||||
(fileinfo.name[1] == 'p' || fileinfo.name[1] == 'P') &&
|
||||
(!_stricmp(fileinfo.name + len - 4, ".zip")
|
||||
|| !_stricmp(fileinfo.name + len - 4, ".jar"))
|
||||
)
|
||||
EDT_RegisterPlugin((LPSTR)((LPCSTR)csFileSpec));
|
||||
#endif
|
||||
}
|
||||
result = _findnext(handle, &fileinfo);
|
||||
}
|
||||
_findclose(handle);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
// called from the navigator main, dispatch to the previous function
|
||||
void FE_RegisterPlugins()
|
||||
{
|
||||
CString csPluginDir;
|
||||
// get the main plugins directory and start the process
|
||||
wfe_GetPluginsDirectory(csPluginDir);
|
||||
fe_RegisterPlugins((LPSTR)(LPCSTR)csPluginDir);
|
||||
CString csJavaDir;
|
||||
wfe_GetJavaDirectory(csJavaDir);
|
||||
JVM_AddToClassPath(csJavaDir);
|
||||
}
|
||||
|
||||
// saves the current path in the variable passed. ppPathSave is the
|
||||
// address of the ptr which stores the path string. returns out of memory
|
||||
// error if allocation for the string returned by _getcwd() fails. returns
|
||||
// generic error if the "one deep" stack is already full.
|
||||
NPError wfe_PushPath(LPSTR *ppPathSave)
|
||||
{
|
||||
// only allow "one deep" stack
|
||||
if(*ppPathSave != NULL)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
||||
// save the CWD
|
||||
*ppPathSave = _getcwd(NULL, 0);
|
||||
if(*ppPathSave == NULL)
|
||||
return NPERR_OUT_OF_MEMORY_ERROR;
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// calculate the drive letter value for _chdrive(). ascii in, int out
|
||||
int wfe_MapAsciiToDriveNum(char cAsciiNum)
|
||||
{
|
||||
int iDriveLetter = cAsciiNum;
|
||||
if(islower(cAsciiNum))
|
||||
iDriveLetter = _toupper(cAsciiNum);
|
||||
// plus one because for _chdrive(), A = 1, B = 2, etc
|
||||
return iDriveLetter - 'A' + 1;
|
||||
}
|
||||
|
||||
// restores the path from the variable passed. pDirSave stores the pointer
|
||||
// to the path string. returns an error if a path has never been pushed.
|
||||
NPError wfe_PopPath(LPSTR pPathSave)
|
||||
{
|
||||
// only allows "one deep" stack
|
||||
if(pPathSave == NULL)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
||||
// restore the drive
|
||||
int chdriveErr = _chdrive(wfe_MapAsciiToDriveNum(pPathSave[0]));
|
||||
|
||||
// restore the CWD
|
||||
int chdirErr = _chdir(pPathSave);
|
||||
free(pPathSave);
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
static void
|
||||
fe_MaybeUnloadPlugin(NPPMgtBlk* mgtBlock)
|
||||
{
|
||||
nsCanUnloadProc nsCanUnload = (nsCanUnloadProc)
|
||||
PR_FindSymbol(mgtBlock->pLibrary, "NSCanUnload");
|
||||
if (nsCanUnload) {
|
||||
PRBool canUnload = nsCanUnload();
|
||||
if (canUnload) {
|
||||
PR_UnloadLibrary(mgtBlock->pLibrary);
|
||||
mgtBlock->pLibrary = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load a plugin dll. "pluginType" is a handle to a plugin management data
|
||||
// structure created during FE_RegisterPlugins(). "pNavigatorFuncs" is
|
||||
// a table of entry points into Navigator, which are the services provided
|
||||
// by Navigator to plugins, such as requestread() and GetUrl(). These entry
|
||||
// points are stored and called by the plugin when services are needed.
|
||||
// The return val is a table of functions which are entry points to the
|
||||
// newly loaded plugin, such as NewStream() and Write().
|
||||
NPPluginFuncs* FE_LoadPlugin(void* pluginType, NPNetscapeFuncs* pNavigatorFuncs, np_handle* handle)
|
||||
{
|
||||
if(pluginType == NULL)
|
||||
return NULL;
|
||||
|
||||
NPPMgtBlk* pNPMgtBlock = (NPPMgtBlk*)pluginType;
|
||||
|
||||
CString csPluginDir;
|
||||
#ifdef OJI
|
||||
char* szExplicitDLL = strrchr(pNPMgtBlock->pPluginFilename, '\\');
|
||||
if( szExplicitDLL ) {
|
||||
csPluginDir = pNPMgtBlock->pPluginFilename; // MFC copies the string
|
||||
csPluginDir.SetAt( szExplicitDLL - pNPMgtBlock->pPluginFilename, '\0');
|
||||
} else {
|
||||
wfe_GetPluginsDirectory(csPluginDir);
|
||||
}
|
||||
#else
|
||||
wfe_GetPluginsDirectory(csPluginDir);
|
||||
#endif /* OJI */
|
||||
|
||||
LPSTR pPathSave = NULL; // storage for one dir spec
|
||||
|
||||
wfe_PushPath(&pPathSave); // save the current drive and dir
|
||||
|
||||
// change the default dir so that implib'd plugins won't fail
|
||||
if(_chdir(csPluginDir) != 0) {
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// must change the drive as well as the dir path
|
||||
if(isalpha(csPluginDir[0]) && csPluginDir[1] == ':') {
|
||||
if(_chdrive(wfe_MapAsciiToDriveNum(csPluginDir[0])) != 0) {
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
pNPMgtBlock->pLibrary = PR_LoadLibrary(pNPMgtBlock->pPluginFilename);
|
||||
|
||||
// the cross platform code should take care of the 16/32 bit issues
|
||||
if(pNPMgtBlock->pLibrary == NULL)
|
||||
return NULL;
|
||||
|
||||
nsFactoryProc nsGetFactory = (nsFactoryProc)
|
||||
PR_FindSymbol(pNPMgtBlock->pLibrary, "NSGetFactory");
|
||||
if (nsGetFactory != NULL) {
|
||||
static NS_DEFINE_IID(kIPluginIID, NS_IPLUGIN_IID);
|
||||
nsIPlugin* plugin = NULL;
|
||||
nsIServiceManager* serviceMgr = NULL;
|
||||
nsresult res = nsServiceManager::GetGlobalServiceManager(&serviceMgr);
|
||||
if (res == NS_OK
|
||||
&& (res = nsGetFactory(kIPluginIID, (nsIFactory**)&plugin, serviceMgr)) == NS_OK) {
|
||||
|
||||
handle->userPlugin = plugin;
|
||||
plugin->AddRef(); // the browser's reference
|
||||
pNPMgtBlock->pPluginFuncs = (NPPluginFuncs*)-1; // something to say it's loaded, but != 0
|
||||
#ifdef LATER // XXX coming soon...
|
||||
// add the plugin directory if successful
|
||||
JVM_AddToClassPathRecursively(csPluginDir);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
NP_GETENTRYPOINTS getentrypoints =
|
||||
(NP_GETENTRYPOINTS)PR_FindSymbol(pNPMgtBlock->pLibrary, "NP_GetEntryPoints");
|
||||
if(getentrypoints == NULL)
|
||||
{
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(pNPMgtBlock->pPluginFuncs == NULL)
|
||||
{
|
||||
pNPMgtBlock->pPluginFuncs = new NPPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs->size = sizeof NPPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs->javaClass = NULL;
|
||||
if(pNPMgtBlock->pPluginFuncs == NULL) // fatal, can't continue
|
||||
{
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(getentrypoints(pNPMgtBlock->pPluginFuncs) != NPERR_NO_ERROR)
|
||||
{
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
delete pNPMgtBlock->pPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs = NULL;
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// if the plugin's major ver level is lower than the Navigator's,
|
||||
// then they are incompatible, and should return an error
|
||||
if(HIBYTE(pNPMgtBlock->pPluginFuncs->version) < NP_VERSION_MAJOR)
|
||||
{
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
delete pNPMgtBlock->pPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs = NULL;
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NP_PLUGININIT npinit = NULL;
|
||||
|
||||
// if this DLL is not already loaded, call its initialization entry point
|
||||
if(pNPMgtBlock->uRefCount == 0) {
|
||||
// the NP_Initialize entry point was misnamed as NP_PluginInit, early
|
||||
// in plugin project development. Its correct name is documented
|
||||
// now, and new developers expect it to work. However, I don't want
|
||||
// to break the plugins already in the field, so I'll accept either
|
||||
// name
|
||||
npinit =
|
||||
(NP_PLUGININIT)PR_FindSymbol(pNPMgtBlock->pLibrary, "NP_Initialize");
|
||||
if(!npinit) {
|
||||
npinit =
|
||||
(NP_PLUGININIT)PR_FindSymbol(pNPMgtBlock->pLibrary, "NP_PluginInit");
|
||||
}
|
||||
}
|
||||
|
||||
if(npinit == NULL) {
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
delete pNPMgtBlock->pPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs = NULL;
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (npinit(pNavigatorFuncs) != NPERR_NO_ERROR) {
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlock);
|
||||
delete pNPMgtBlock->pPluginFuncs;
|
||||
pNPMgtBlock->pPluginFuncs = NULL;
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
pNPMgtBlock->uRefCount++; // all is well, remember it was loaded
|
||||
|
||||
// can't pop the path until plugins have been completely loaded/init'd
|
||||
wfe_PopPath(pPathSave); // restore the path
|
||||
return pNPMgtBlock->pPluginFuncs;
|
||||
}
|
||||
|
||||
// Unloads a plugin DLL. "pluginType" is a handle to a plugin management data
|
||||
// structure created during FE_RegisterPlugins(). There is no return val.
|
||||
void FE_UnloadPlugin(void* pluginType, struct _np_handle* handle)
|
||||
{
|
||||
NPPMgtBlk* pNPMgtBlk = (NPPMgtBlk*)pluginType;
|
||||
if (pNPMgtBlk == NULL)
|
||||
return;
|
||||
|
||||
// XXX Note that we're double refcounting here. If we were rewriting this
|
||||
// from scratch, we could eliminate this pNPMgtBlk and its refcount and just
|
||||
// rely on the one in the userPlugin.
|
||||
|
||||
pNPMgtBlk->uRefCount--; // another one bites the dust
|
||||
|
||||
// if this DLL is the last one, call its shutdown entry point
|
||||
if (pNPMgtBlk->uRefCount == 0) {
|
||||
if (handle->userPlugin) {
|
||||
nsrefcnt cnt = handle->userPlugin->Release();
|
||||
#if 0 // XXX later...
|
||||
// remove the plugin directory if successful
|
||||
JVM_RemoveFromClassPathRecursively(csPluginDir);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
// the NP_Shutdown entry point was misnamed as NP_PluginShutdown, early
|
||||
// in plugin project development. Its correct name is documented
|
||||
// now, and new developers expect it to work. However, I don't want
|
||||
// to break the plugins already in the field, so I'll accept either
|
||||
// name
|
||||
NP_PLUGINSHUTDOWN npshutdown =
|
||||
(NP_PLUGINSHUTDOWN)PR_FindSymbol(pNPMgtBlk->pLibrary, "NP_Shutdown");
|
||||
if (!npshutdown) {
|
||||
npshutdown =
|
||||
(NP_PLUGINSHUTDOWN)PR_FindSymbol(pNPMgtBlk->pLibrary, "NP_PluginShutdown");
|
||||
}
|
||||
|
||||
if (npshutdown != NULL) {
|
||||
NPError result = npshutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlk);
|
||||
|
||||
if (handle->userPlugin) {
|
||||
PR_ASSERT(pNPMgtBlk->pPluginFuncs == (NPPluginFuncs*)-1); // set in FE_LoadPlugin
|
||||
handle->userPlugin = NULL;
|
||||
}
|
||||
else {
|
||||
delete pNPMgtBlk->pPluginFuncs;
|
||||
}
|
||||
pNPMgtBlk->pPluginFuncs = NULL;
|
||||
}
|
||||
|
||||
// Removes a plugin DLL from memory, and frees its NPPMgtBlk management block.
|
||||
// "pluginType" is a handle to the plugin management data structure created
|
||||
// during FE_RegisterPlugins(). There is no return val.
|
||||
void FE_UnregisterPlugin(void* pluginType)
|
||||
{
|
||||
NPPMgtBlk* pNPMgtBlk = (NPPMgtBlk*)pluginType;
|
||||
if(pNPMgtBlk == NULL)
|
||||
return;
|
||||
|
||||
if(pNPMgtBlk->pLibrary != NULL)
|
||||
fe_MaybeUnloadPlugin(pNPMgtBlk);
|
||||
|
||||
delete [] (char*)*pNPMgtBlk->pPluginFilename;
|
||||
delete [] pNPMgtBlk->pPluginFilename;
|
||||
delete [] pNPMgtBlk->szMIMEType;
|
||||
delete pNPMgtBlk->pPluginFuncs;
|
||||
delete pNPMgtBlk;
|
||||
}
|
||||
|
||||
// Provides the entry point used by xp plugin code, (NPGLUE.C), to control
|
||||
// scroll bars. The inputs are obvious, and there is no return val.
|
||||
void FE_ShowScrollBars(MWContext* pContext, XP_Bool show)
|
||||
{
|
||||
if(ABSTRACTCX(pContext)->IsWindowContext()) {
|
||||
CPaneCX *pPaneCX = PANECX(pContext);
|
||||
|
||||
pPaneCX->ShowScrollBars(SB_BOTH, show);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef XP_WIN32
|
||||
void*
|
||||
WFE_BeginSetModuleState()
|
||||
{
|
||||
return AfxSetModuleState(AfxGetAppModuleState());
|
||||
}
|
||||
|
||||
void
|
||||
WFE_EndSetModuleState(void* pPrevState)
|
||||
{
|
||||
AfxSetModuleState((AFX_MODULE_STATE*)pPrevState);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
2031
mozilla/cmd/winfe/nsapp.cpp
Normal file
2031
mozilla/cmd/winfe/nsapp.cpp
Normal file
File diff suppressed because it is too large
Load Diff
123
mozilla/cmd/winfe/stdafx.h
Normal file
123
mozilla/cmd/winfe/stdafx.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef STDAFX_PCH
|
||||
#define STDAFX_PCH
|
||||
|
||||
#define OEMRESOURCE
|
||||
|
||||
#if defined(DEBUG_blythe)
|
||||
// Set up a flag specific to WFE developers in the client
|
||||
#define DEBUG_WFE
|
||||
#endif
|
||||
|
||||
/* Very windows specific includes.
|
||||
*/
|
||||
/* MFC, KFC, RUN DMC, whatever */
|
||||
#include <afxwin.h>
|
||||
#include <afxext.h>
|
||||
#include <afxpriv.h>
|
||||
#include <afxole.h>
|
||||
#include <afxdisp.h>
|
||||
#include <afxodlgs.h>
|
||||
#ifdef _WIN32
|
||||
#include <afxcmn.h>
|
||||
#endif
|
||||
|
||||
/* More XP than anything */
|
||||
#include "xp.h"
|
||||
#include "fe_proto.h"
|
||||
#include "fe_rgn.h"
|
||||
#include "libi18n.h"
|
||||
#include "xlate.h"
|
||||
#include "ntypes.h"
|
||||
#ifdef EDITOR
|
||||
#include "edttypes.h"
|
||||
#endif
|
||||
#include "xpassert.h"
|
||||
#include "lo_ele.h"
|
||||
#include "layers.h"
|
||||
|
||||
/* Standard C includes */
|
||||
#ifndef _WIN32
|
||||
#include <dos.h>
|
||||
#endif
|
||||
#include <malloc.h>
|
||||
#include <direct.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include <io.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef DEBUG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Very windows specific includes.
|
||||
*/
|
||||
/* WFE needs a layout file */
|
||||
extern "C" {
|
||||
#include "layout.h"
|
||||
}
|
||||
|
||||
/* Some common defines. */
|
||||
#ifndef _AFXDLL
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
/* All front end forward declarations needed to compile. */
|
||||
#include "forward.h"
|
||||
|
||||
/* Front end Casting macros. */
|
||||
#include "cast.h"
|
||||
|
||||
/* General purpose utilities. */
|
||||
#include "feutil.h"
|
||||
|
||||
/* afxData/sysInfo */
|
||||
#include "sysinfo.h"
|
||||
|
||||
/* Some defines we like everywhere. */
|
||||
#include "resource.h"
|
||||
#include "defaults.h"
|
||||
|
||||
/* The application include and
|
||||
* Commonly used, rarely changed headers */
|
||||
#include "ncapiurl.h"
|
||||
#include "genedit.h"
|
||||
#include "genframe.h"
|
||||
#include "genview.h"
|
||||
#include "gendoc.h"
|
||||
#include "intlwin.h"
|
||||
#include "mozilla.h"
|
||||
#include "cxwin.h"
|
||||
#include "winproto.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef assert
|
||||
#undef assert
|
||||
#endif
|
||||
#define assert(x) ASSERT(x)
|
||||
#endif
|
||||
|
||||
#endif /* STDAFX_PCH */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# $XConsortium: C,v 1.4 91/06/29 20:01:32 xguest Exp $
|
||||
#
|
||||
# Copyright 1990, 1991 by OMRON Corporation, NTT Software Corporation,
|
||||
# and Nippon Telegraph and Telephone Corporation
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the names of OMRON, NTT Software, NTT, and M.I.T.
|
||||
# not be used in advertising or publicity pertaining to distribution of the
|
||||
# software without specific, written prior permission. OMRON, NTT Software,
|
||||
# NTT, and M.I.T. make no representations about the suitability of this
|
||||
# software for any purpose. It is provided "as is" without express or
|
||||
# implied warranty.
|
||||
#
|
||||
# OMRON, NTT SOFTWARE, NTT, AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
# AND FITNESS, IN NO EVENT SHALL OMRON, NTT SOFTWARE, NTT, OR M.I.T. BE
|
||||
# LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
# Author: Li Yuhong OMRON Corporation
|
||||
#
|
||||
########################################################################
|
||||
#
|
||||
# Locale Name: C
|
||||
#
|
||||
XLC_ALL
|
||||
C
|
||||
END XLC_ALL
|
||||
|
||||
XLC_ENCODING
|
||||
STRING
|
||||
END XLC_ENCODING
|
||||
|
||||
XLC_FONTSET
|
||||
#
|
||||
# Definition Format: XLFD
|
||||
#
|
||||
# ASCII: ISO 8859-1
|
||||
iso8859-1:GL
|
||||
END XLC_FONTSET
|
||||
|
||||
XLC_CODESET
|
||||
#
|
||||
# type:CS0_mblen
|
||||
#
|
||||
L:1
|
||||
#
|
||||
# This mapping list was generated by program, DO NOT CHANGE IT!
|
||||
#
|
||||
#00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
|
||||
#
|
||||
{
|
||||
C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0,
|
||||
C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0, C0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,CS0,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND, ND,
|
||||
}
|
||||
#
|
||||
# The following conversion list is hexdecimal.
|
||||
#
|
||||
# CS0: ASCII, ISO 8859-1
|
||||
#
|
||||
(20=20:7f)
|
||||
END XLC_CODESET
|
||||
#
|
||||
# END OF FILE
|
||||
#
|
||||
@@ -1,301 +0,0 @@
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
Notes/Issues:
|
||||
- The list menu is posted on the select button release. In order to
|
||||
be like Windows, the menu would come up on the button press, and allow
|
||||
the user to drag immediately, without letting go of the select button.
|
||||
When I wrote the widget, I didn't have time to investigate getting this
|
||||
drag to work. We would have to simulate the select press inside the
|
||||
list, I imagine.
|
||||
- No key pattern matching available.
|
||||
- Lack of translation table functionality.
|
||||
|
||||
|
||||
1. ComboBox Widget
|
||||
|
||||
1.1 Widget Class Name
|
||||
|
||||
ComboBox
|
||||
|
||||
1.2 Synopsis
|
||||
|
||||
#include "ComboBox.h"
|
||||
|
||||
widget = DtCreateComboBox(parent, name, arglist, num_args);
|
||||
XtManageChild(widget);
|
||||
|
||||
1.3 Description
|
||||
|
||||
1.4 Resources
|
||||
|
||||
Property Type Init Access
|
||||
-------- ---- ---- ------
|
||||
XmNactivateCallback CallbackList NULL CSG
|
||||
XmNalignment unsigned char XmALIGNMENT_BEGINNING CSG
|
||||
XmNarrowSpacing Dimension 0 CSG
|
||||
XmNarrowSize Dimension dynamic G
|
||||
XmNarrowType unsigned char XmWINDOWS CSG
|
||||
XmNcolumns Integer 20 CSG
|
||||
XmNfocusCallback CallbackList NULL CSG
|
||||
XmNitemCount Unsigned Integer 0 CSG
|
||||
XmNitems XmStringTable NULL CSG
|
||||
XmNlabelString XmString NULL CSG
|
||||
XmNlist Widget NULL G
|
||||
XmNlistFontList FontList NULL CSG
|
||||
XmNlistMarginHeight Dimension 2 CSG
|
||||
XmNlistMarginWidth Dimension 2 CSG
|
||||
XmNlistSpacing Dimension 0 CSG
|
||||
XmNlosingFocusCallback CallbackList NULL CSG
|
||||
XmNmarginHeight Dimension 2 CSG
|
||||
XmNmarginWidth Dimension 2 CSG
|
||||
XmNmaxLength Unsigned Integer MAXINT CSG
|
||||
XmNmenuPostCallback CallbackList NULL CSG
|
||||
XmNorientation unsigned char XmRIGHT CSG
|
||||
XmNpoppedUp Boolean FALSE G
|
||||
XmNrecomputeSize Boolean TRUE CSG
|
||||
XmNselectedItem XmString NULL CSG
|
||||
XmNselectedPosition Unsigned Integer 0 CSG
|
||||
XmNselectionCallback CallbackList NULL CSG
|
||||
XmNtextField Widget NULL G
|
||||
XmNtopItemPosition Unsigned Integer 1 CSG
|
||||
XmNtype unsigned char XmDROP_DOWN_LIST_BOX CSG
|
||||
XmNupdateLabel Boolean TRUE CSG
|
||||
XmNvisibleItemCount Unsigned Integer 10 CSG
|
||||
|
||||
XmNactivateCallback:
|
||||
List of callbacks called when the user does KActivate in
|
||||
the text-field widget (when ComboBox is
|
||||
XmDROP_DOWN_COMBO_BOX). See also XmTextFieldWidget.
|
||||
|
||||
XmNalignment:
|
||||
Alignment of the text within the non-editable label.
|
||||
This only gets used if XmNtype is XmDROP_DOWN_LIST_BOX.
|
||||
Values are:
|
||||
XmALIGNMENT_CENTER, XmALIGNMENT_BEGINNING,
|
||||
XmALIGNMENT_END
|
||||
See also XmLabelWidget
|
||||
|
||||
XmNarrowSpacing:
|
||||
Amount of space between the arrow and the label or
|
||||
text-field (in pixels).
|
||||
|
||||
XmNarrowSize:
|
||||
Height/Width of arrow. This is not a settable resource;
|
||||
it is based on the height of the ComboBox (which is
|
||||
related to the font used).
|
||||
|
||||
XmNarrowType:
|
||||
Type of down arrow displayed in the ComboBox. The legal
|
||||
values are: XmWINDOWS, XmMOTIF
|
||||
|
||||
Xmcolumns:
|
||||
This resource is passed on to the text-field widget.
|
||||
See also XmTextFieldWidget.
|
||||
|
||||
XmNfocusCallback:
|
||||
List of callbacks called when the text-field widget accepts
|
||||
focus (when ComboBox is editable - XmDROP_DOWN_COMBO_BOX).
|
||||
See also XmTextFieldWidget.
|
||||
|
||||
XmNitemCount:
|
||||
Total number of items. This value must be the number of
|
||||
items in XmNitems and must not be negative. It is
|
||||
automatically updated by the widget whenever an item
|
||||
is added or deleted.
|
||||
|
||||
XmNitems:
|
||||
A list of xm-strings which will be displayed in the drop
|
||||
down list box.
|
||||
|
||||
XmNlabelString:
|
||||
This is the string that will be used in the label when the
|
||||
resource XmNupdateLabel is FALSE. This string will remain
|
||||
in the label as long as the XmNupdateLayout resource is
|
||||
FALSE, even if the user picks a new item off the list.
|
||||
|
||||
XmNlist:
|
||||
List widget (which is inside the popup). Gettable only.
|
||||
|
||||
XmNlistFontList:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNfontList resource.
|
||||
See also XmListWidget.
|
||||
|
||||
XmNlistMarginHeight:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNlistMarginHeight resource.
|
||||
See also XmListWidget.
|
||||
|
||||
XmNlistMarginWidth:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNlistMarginWidth resource.
|
||||
See also XmListWidget.
|
||||
|
||||
XmNlistSpacing:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNlistSpacing resource.
|
||||
See also XmListWidget.
|
||||
|
||||
XmNlosingFocusCallback:
|
||||
List of callbacks called when the text-field widget loses
|
||||
focus (when ComboBox is editable - XmDROP_DOWN_COMBO_BOX).
|
||||
See also XmTextFieldWidget.
|
||||
|
||||
XmNmarginHeight:
|
||||
Vertical distance from the beginning of the widget to the
|
||||
start of the shadow. Used for making this widget
|
||||
look like push-buttons, etc.
|
||||
|
||||
XmNmarginWidth:
|
||||
Horizontal distance from the beginning of the widget to
|
||||
the start of the shadow. Used for making this widget
|
||||
look like push-buttons, etc.
|
||||
|
||||
XmNmaxLength:
|
||||
Maximum length of the text string that can be entered into
|
||||
a text-field widget. This resource is passed on to the
|
||||
text-field (when ComboBox is editable - XmDROP_DOWN_COMBO_BOX).
|
||||
See also XmTextFieldWidget.
|
||||
|
||||
XmNmenuPostCallback:
|
||||
List of callbacks called right before the list menu
|
||||
gets put on the screen.
|
||||
|
||||
XmNorientation:
|
||||
Specifies location of down arrow. Legal values are:
|
||||
XmLEFT, XmRIGHT
|
||||
|
||||
XmNpoppedUp:
|
||||
Returns TRUE if the list menu is mapped; otherwise, FALSE.
|
||||
|
||||
XmNrecomputeSize:
|
||||
If FALSE, the widget will not try to recompute a new
|
||||
size if setting some other resource would cause it
|
||||
to grow or shrink.
|
||||
|
||||
XmNselectedItem:
|
||||
Item currently visible in list. Can be used to
|
||||
change selected item. User must make copy of this
|
||||
before modifying.
|
||||
|
||||
XmNselectedPosition:
|
||||
Position of item, within scrolling list, currently
|
||||
visible (in label or text-field). Can be used
|
||||
to change selected item. Starts at 0.
|
||||
|
||||
XmNselectionCallback:
|
||||
List of callbacks called when the user selects something
|
||||
off the list (the list's XmNdefaultActionCallback or
|
||||
XmNbrowseSelectionCallback callbacks).
|
||||
See also XmListWidget.
|
||||
|
||||
XmNtextField:
|
||||
text-field widget used within the ComboBox when
|
||||
XmNtype is XmDROP_DOWN_COMBO_BOX.
|
||||
|
||||
XmNtopItemPosition:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNtopItemPosition resource.
|
||||
See also XmListWidget.
|
||||
|
||||
XmNtype:
|
||||
Type of combo-box create. Legal values are:
|
||||
XmDROP_DOWN_LIST_BOX (non-editable, uses label)
|
||||
XmDROP_DOWN_COMBO_BOX (editable, uses text-field)
|
||||
|
||||
XmNupdateLabel:
|
||||
If TRUE, the contents of the label will change when the
|
||||
user picks a new item off the list. If FALSE, the
|
||||
label will not update, and the resource XmNlabelString
|
||||
will be used as the label.
|
||||
|
||||
XmNvisibleItemCount:
|
||||
This resource is passed on to the XmListWidget as the
|
||||
XmNvisibleItemCount resource.
|
||||
See also XmListWidget.
|
||||
|
||||
|
||||
========================================================================
|
||||
|
||||
Functions available for ComboBox widget.
|
||||
|
||||
Widget
|
||||
DtCreateComboBox(parent, name, args, num_args)
|
||||
Widget parent;
|
||||
char *name;
|
||||
ArgList args;
|
||||
int num_args;
|
||||
{
|
||||
}
|
||||
|
||||
Creates an instance of a ComboBox widget.
|
||||
|
||||
|
||||
void
|
||||
DtComboBoxAddItem(widget, item, position, unique)
|
||||
DtComboBoxWidget widget;
|
||||
XmString item;
|
||||
int position;
|
||||
Boolean unique;
|
||||
|
||||
Adds the given item to the list at the given position.
|
||||
position is an integer specifying the position of the new item in the
|
||||
list. A value of 1 makes the new item the first item in the list; a value
|
||||
of 2 makes it the second item, and so on. A value of 0 (zero) makes the new
|
||||
item the last item in the list.
|
||||
If the unique parameter is TRUE, the item will only be added if it doesn't
|
||||
already exist. If it is FALSE, the item will always be added.
|
||||
See also, XmListSelectItem in the Motif reference manual.
|
||||
|
||||
|
||||
void
|
||||
DtComboBoxDeletePos(widget, position)
|
||||
DtComboBoxWidget widget;
|
||||
int position;
|
||||
|
||||
Deletes the item at the given position from the list.
|
||||
position is an integer specifying the position of the item to delete
|
||||
in the list. A value of 1 indicates that the first item in the list is
|
||||
to be deleted. A value of 2 indicates the second item, etc. A value of 0
|
||||
indicates that the last item is to be deleted. See also,
|
||||
XmListSelectItem in the Motif reference manual.
|
||||
|
||||
void
|
||||
DtComboBoxSetItem(widget, item)
|
||||
DtComboBoxWidget widget;
|
||||
XmString item;
|
||||
|
||||
Puts the given item into the combo-box label or text-field (this will be the
|
||||
new value shown). The given item will be positioned at the top of the
|
||||
list. This may cause problems if the viewing area is larger than the
|
||||
number of items in the list. The new item will not be selected (use
|
||||
DtComboBoxSelectItem).
|
||||
See also, XmListSetItem in the Motif reference manual.
|
||||
|
||||
|
||||
void
|
||||
DtComboBoxSelectItem(combo, item)
|
||||
DtComboBoxWidget combo;
|
||||
XmString item;
|
||||
|
||||
Puts the given item into the combo-box label or text-field (this will be the
|
||||
new value shown). The currently selected item in the list will be deselected
|
||||
and the given item will be selected. See also, XmListSelectItem in the Motif
|
||||
reference manual.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* ComboBox.h, Interleaf, 16aug93 2:37pm Version 1.1.
|
||||
*/
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
/*
|
||||
* (C) Copyright 1991,1992, 1993
|
||||
* Interleaf, Inc.
|
||||
* Nine Hillside Avenue, Waltham, MA 02154
|
||||
*
|
||||
* ComboBox.h:
|
||||
*
|
||||
* Public header file for DtComboBoxWidget.
|
||||
*/
|
||||
#ifndef _ComboBox_h
|
||||
#define _ComboBox_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef AA
|
||||
#define AA(args) ()
|
||||
#endif
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifndef XmNarrowSize
|
||||
#define XmNarrowSize "arrowSize"
|
||||
#endif
|
||||
#ifndef XmNarrowSpacing
|
||||
#define XmNarrowSpacing "arrowSpacing"
|
||||
#endif
|
||||
#define XmNarrowType "arrowType"
|
||||
#ifndef XmNlist
|
||||
#define XmNlist "list"
|
||||
#endif
|
||||
#define XmNlistFontList "listFontList"
|
||||
#define XmNpoppedUp "poppedUp"
|
||||
#ifndef XmNselectedPosition
|
||||
#define XmNselectedPosition "selectedPosition"
|
||||
#endif
|
||||
#ifndef XmNselectedItem
|
||||
#define XmNselectedItem "selectedItem"
|
||||
#endif
|
||||
#ifndef XmNtextField
|
||||
#define XmNtextField "textField"
|
||||
#endif
|
||||
#define XmNtype "type"
|
||||
#define XmNupdateLabel "updateLabel"
|
||||
#define XmNmoveSelectedItemUp "moveSelectedItemUp"
|
||||
#define XmNnoCallbackForArrow "noCallbackForArrow"
|
||||
|
||||
#ifndef XmCArrowSize
|
||||
#define XmCArrowSize "ArrowSize"
|
||||
#endif
|
||||
#ifndef XmCArrowSpacing
|
||||
#define XmCArrowSpacing "ArrowSpacing"
|
||||
#endif
|
||||
#define XmCArrowType "ArrowType"
|
||||
#define XmCHorizontalSpacing "HorizontalSpacing"
|
||||
#ifndef XmCList
|
||||
#define XmCList "List"
|
||||
#endif
|
||||
#define XmCListFontList "ListFontList"
|
||||
#define XmCPoppedUp "PoppedUp"
|
||||
#ifndef XmCSelectedPosition
|
||||
#define XmCSelectedPosition "SelectedPosition"
|
||||
#endif
|
||||
#ifndef XmCSelectedItem
|
||||
#define XmCSelectedItem "SelectedItem"
|
||||
#endif
|
||||
#define XmCType "Type"
|
||||
#ifndef XmCTextField
|
||||
#define XmCTextField "TextField"
|
||||
#endif
|
||||
#define XmCUpdateLabel "UpdateLabel"
|
||||
#define XmCVerticalSpacing "VerticalSpacing"
|
||||
#define XmCMoveSelectedItemUp "MoveSelectedItemUp"
|
||||
#define XmCNoCallbackForArrow "NoCallbackForArrow"
|
||||
|
||||
#define XmRArrowType "ArrowType"
|
||||
#define XmRType "Type"
|
||||
|
||||
/* XmNorientation defines */
|
||||
#define XmLEFT 0
|
||||
#define XmRIGHT 1
|
||||
|
||||
/* ArrowType defines */
|
||||
#define XmMOTIF 0
|
||||
#define XmWINDOWS 1
|
||||
|
||||
/* XmNtype defines */
|
||||
#define XmDROP_DOWN_LIST_BOX 0
|
||||
#define XmDROP_DOWN_COMBO_BOX 1
|
||||
|
||||
/* ComboBox callback info */
|
||||
#ifndef XmNselectionCallback
|
||||
#define XmNselectionCallback "selectionCallback"
|
||||
#endif
|
||||
#define XmNmenuPostCallback "menuPostCallback"
|
||||
#define XmCR_SELECT 128 /* Large #, so no collisions with XM */
|
||||
#define XmCR_MENU_POST 129 /* Large #, so no collisions with XM */
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
XmString item_or_text;
|
||||
int item_position;
|
||||
} DtComboBoxCallbackStruct;
|
||||
|
||||
extern WidgetClass dtComboBoxWidgetClass;
|
||||
|
||||
typedef struct _DtComboBoxClassRec *DtComboBoxWidgetClass;
|
||||
typedef struct _DtComboBoxRec *DtComboBoxWidget;
|
||||
|
||||
/*
|
||||
* External functions which manipulate the ComboBox list of items.
|
||||
*/
|
||||
extern Widget DtCreateComboBox (Widget parent, char *name,
|
||||
Arg *arglist, int num_args);
|
||||
extern void DtComboBoxAddItem (Widget combo, XmString item,
|
||||
int pos, Boolean unique);
|
||||
extern void DtComboBoxDeletePos (Widget combo, int pos);
|
||||
extern void DtComboBoxDeleteAllItems(Widget combo);
|
||||
extern void DtComboBoxSetItem (Widget combo, XmString item);
|
||||
extern void DtComboBoxSelectItem (Widget combo, XmString item);
|
||||
|
||||
/* xfe additions */
|
||||
extern void DtComboBoxAddItemSelected (Widget combo, XmString item, int pos, Boolean unique);
|
||||
extern void DtComboBoxDeleteAllItems (Widget combo);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* _ComboBox_h */
|
||||
@@ -1,186 +0,0 @@
|
||||
/*
|
||||
* ComboBoxP.h, Interleaf, 16aug93 2:37pm Version 1.1.
|
||||
*/
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
/*
|
||||
* (C) Copyright 1991,1992, 1993
|
||||
* Interleaf, Inc.
|
||||
* Nine Hillside Avenue, Waltham, MA 02154
|
||||
*
|
||||
* ComboBoxP.h:
|
||||
*
|
||||
* Private header file for DtComboBoxWidget.
|
||||
*/
|
||||
#ifndef _ComboBoxP_h
|
||||
#define _ComboBoxP_h
|
||||
|
||||
#ifndef AA
|
||||
#define AA(args) ()
|
||||
#endif
|
||||
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/ShellP.h>
|
||||
#include <Xm/DrawnB.h>
|
||||
#include <Xm/ArrowB.h>
|
||||
#include <Xm/TextFP.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/ListP.h>
|
||||
#include <Xm/Separator.h>
|
||||
#include <Xm/ScrolledWP.h>
|
||||
#include <Xm/ScrollBarP.h>
|
||||
|
||||
#include <Xm/ManagerP.h>
|
||||
#include "ComboBox.h"
|
||||
|
||||
/*
|
||||
* External definitions of syn_resources for our list widget.
|
||||
*/
|
||||
#define SYN_RESOURCE_AA AA((Widget w, int resource_offset, XtArgVal *value))
|
||||
extern void _DtComboBoxGetArrowSize SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetLabelString SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListItemCount SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListItems SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListFontList SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListMarginHeight SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListMarginWidth SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListSpacing SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListTopItemPosition SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListVisibleItemCount SYN_RESOURCE_AA;
|
||||
|
||||
#define ARROW_MULT .45
|
||||
#define ARROW_MIN 13
|
||||
#define MARGIN 2
|
||||
#define LABEL_PADDING 2
|
||||
#define LABEL_SHADOW 2
|
||||
#define TEXT_FIELD_SHADOW 1
|
||||
|
||||
/*
|
||||
* Class Records
|
||||
*/
|
||||
typedef struct {
|
||||
Boolean junk; /* Need something */
|
||||
} DtComboBoxClassPart;
|
||||
|
||||
typedef struct _DtComboBoxClassRec {
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
DtComboBoxClassPart combo_box_class;
|
||||
} DtComboBoxClassRec;
|
||||
|
||||
extern DtComboBoxClassRec dtComboBoxClassRec;
|
||||
|
||||
|
||||
/*
|
||||
* Instance Record.
|
||||
*/
|
||||
typedef struct _DtComboBoxPart {
|
||||
/* Private data */
|
||||
Widget arrow;
|
||||
Widget shell;
|
||||
Widget frame;
|
||||
Widget label;
|
||||
Widget sep;
|
||||
Dimension old_width;
|
||||
Dimension old_height;
|
||||
Dimension label_max_length;
|
||||
Dimension label_max_height;
|
||||
/*
|
||||
* max_shell_width is the width that is needed to hold the
|
||||
* list if the longest item was visible. We then use this
|
||||
* width to figure out if the shell is not wide enough,
|
||||
* when it gets popped on the screen. This is needed in case the
|
||||
* combo-box resizes, or if items changes (list will resize).
|
||||
* Sometimes we change the size of the shell to fit on the screen, or
|
||||
* to make it at least as large as the combo_box. The next time we pop
|
||||
* the shell up the size may be different; therefore, we set the shell
|
||||
* size to the maximum everytime it gets popped up, then we will
|
||||
* make adjustments, only if needed.
|
||||
* This value gets saved every time the user updates XmNitems.
|
||||
*/
|
||||
Dimension max_shell_width;
|
||||
Dimension max_shell_height;
|
||||
|
||||
/* ComboBox specific resources */
|
||||
XtCallbackList activate_callback;
|
||||
unsigned char alignment;
|
||||
Dimension arrow_size;
|
||||
Dimension arrow_spacing;
|
||||
unsigned char arrow_type;
|
||||
short text_columns;
|
||||
XtCallbackList focus_callback;
|
||||
Dimension horizontal_spacing;
|
||||
int item_count;
|
||||
XmStringTable items;
|
||||
XmString label_string;
|
||||
Widget list;
|
||||
XmFontList list_font_list;
|
||||
Dimension list_margin_height;
|
||||
Dimension list_margin_width;
|
||||
Dimension list_spacing;
|
||||
XtCallbackList losing_focus_callback;
|
||||
Dimension margin_height;
|
||||
Dimension margin_width;
|
||||
unsigned int text_max_length;
|
||||
XtCallbackList menu_post_callback;
|
||||
unsigned char orientation;
|
||||
Boolean popped_up;
|
||||
Boolean recompute_size;
|
||||
XmString selected_item;
|
||||
int selected_position;
|
||||
XtCallbackList selection_callback;
|
||||
Widget text;
|
||||
int top_item_position;
|
||||
unsigned char type;
|
||||
Boolean update_label;
|
||||
Dimension vertical_spacing;
|
||||
int visible_item_count;
|
||||
Boolean move_selecteditem_up;
|
||||
Boolean no_callback_for_arrow;
|
||||
} DtComboBoxPart;
|
||||
|
||||
|
||||
typedef struct _DtComboBoxRec {
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
DtComboBoxPart combo_box;
|
||||
} DtComboBoxRec;
|
||||
|
||||
|
||||
/*
|
||||
* Error defines.
|
||||
*/
|
||||
#define COMBO_ALIGNMENT "DtComboButtonWidget: Invalid alignment resource (defaulting to XmALIGNMENT_CENTER)."
|
||||
#define COMBO_MARGIN_HEIGHT "DtComboButtonWidget: Invalid marginHeight resource (defaulting to 2)."
|
||||
#define COMBO_MARGIN_WIDTH "DtComboButtonWidget: Invalid marginHeight resource (defaulting to 2)."
|
||||
#define COMBO_HORIZONTAL_SPACING "DtComboButtonWidget: Invalid horizontalSpacing resource (defaulting to 0)."
|
||||
#define COMBO_VERTICAL_SPACING "DtComboButtonWidget: Invalid verticalSpacing resource (defaulting to 0)."
|
||||
#define COMBO_ORIENTATION "DtComboButtonWidget: Invalid orientation resource (defaulting to XmRIGHT)."
|
||||
#define COMBO_ITEM_COUNT "DtComboButtonWidget: Invalid itemCount resource (defaulting to 0)."
|
||||
#define COMBO_VISIBLE_ITEM "DtComboButtonWidget: Invalid selectedPosition resource (defaulting to 0)."
|
||||
#define COMBO_TEXT "DtComboButtonWidget: Unable to set textField resource."
|
||||
#define COMBO_ITEM_COUNT "DtComboButtonWidget: Invalid itemCount resource (defaulting to 0)."
|
||||
#define COMBO_SET_ITEM "DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem)."
|
||||
#define COMBO_SELECT_ITEM "DtComboBoxWidget: Unable to find item to select (XmComboBoxSelectItem)."
|
||||
|
||||
|
||||
#endif /* _XmComboBoxP_h */
|
||||
@@ -1,30 +0,0 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = DtWidgets
|
||||
LIBRARY_NAME = DtWidgets
|
||||
|
||||
CSRCS = ComboBox.c
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,31 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
DIRS = XmL
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
@@ -1,36 +0,0 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = XmL
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,57 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLFolderH
|
||||
#define XmLFolderH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlFolderWidgetClass;
|
||||
typedef struct _XmLFolderClassRec *XmLFolderWidgetClass;
|
||||
typedef struct _XmLFolderRec *XmLFolderWidget;
|
||||
|
||||
#define XmLIsFolder(w) XtIsSubclass((w), xmlFolderWidgetClass)
|
||||
|
||||
Widget XmLCreateFolder(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
Widget XmLFolderAddBitmapTab(Widget w, XmString string,
|
||||
char *bitmapBits, int bitmapWidth, int bitmapHeight);
|
||||
Widget XmLFolderAddBitmapTabForm(Widget w, XmString string,
|
||||
char *bitmapBits, int bitmapWidth, int bitmapHeight);
|
||||
Widget XmLFolderAddTab(Widget w, XmString string);
|
||||
Widget XmLFolderAddTabFromClass(Widget w, XmString string);
|
||||
Widget XmLFolderAddTabForm(Widget w, XmString string);
|
||||
void XmLFolderSetActiveTab(Widget w, int position, Boolean notify);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,113 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLFolderPH
|
||||
#define XmLFolderPH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
|
||||
#ifdef MOTIF11
|
||||
#else
|
||||
#include <Xm/ManagerP.h>
|
||||
#endif
|
||||
|
||||
#include "Folder.h"
|
||||
|
||||
typedef struct _XmLFolderPart
|
||||
{
|
||||
int debugLevel;
|
||||
Boolean serverDrawsArcsLarge;
|
||||
unsigned char cornerStyle, tabPlacement, resizePolicy;
|
||||
Boolean allowRotate, autoSelect;
|
||||
GC gc;
|
||||
Pixel inactiveBg, inactiveFg, blankBg;
|
||||
Pixmap blankPix;
|
||||
WidgetList tabs;
|
||||
int tabCount, tabAllocCount;
|
||||
Dimension marginWidth, marginHeight, spacing;
|
||||
Dimension cornerDimension, highlightThickness;
|
||||
Dimension pixmapMargin;
|
||||
Dimension tabHeight, tabWidth, tabBarHeight;
|
||||
int tabsPerRow, activeRow;
|
||||
XtTranslations primTrans;
|
||||
Widget focusW, activeW;
|
||||
int activeTab;
|
||||
char allowLayout;
|
||||
XtCallbackList activateCallback;
|
||||
XmFontList fontList;
|
||||
|
||||
WidgetClass tabWidgetClass;
|
||||
|
||||
} XmLFolderPart;
|
||||
|
||||
typedef struct _XmLFolderRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmLFolderPart folder;
|
||||
} XmLFolderRec;
|
||||
|
||||
typedef struct _XmLFolderClassPart
|
||||
{
|
||||
int unused;
|
||||
} XmLFolderClassPart;
|
||||
|
||||
typedef struct _XmLFolderClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmLFolderClassPart folder_class;
|
||||
} XmLFolderClassRec;
|
||||
|
||||
extern XmLFolderClassRec xmlFolderClassRec;
|
||||
|
||||
typedef struct _XmLFolderConstraintPart
|
||||
{
|
||||
Position x, y;
|
||||
Dimension width, height;
|
||||
Dimension maxPixWidth, maxPixHeight;
|
||||
Dimension pixWidth, pixHeight;
|
||||
Dimension inactPixWidth, inactPixHeight;
|
||||
int row;
|
||||
Boolean firstInRow;
|
||||
Boolean freePix;
|
||||
Pixmap pix, inactPix;
|
||||
char *managedName;
|
||||
Widget managedW;
|
||||
} XmLFolderConstraintPart;
|
||||
|
||||
typedef struct _XmLFolderConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager;
|
||||
XmLFolderConstraintPart folder;
|
||||
} XmLFolderConstraintRec, *XmLFolderConstraintPtr;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,147 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLGridH
|
||||
#define XmLGridH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlGridWidgetClass;
|
||||
typedef struct _XmLGridClassRec *XmLGridWidgetClass;
|
||||
typedef struct _XmLGridRec *XmLGridWidget;
|
||||
typedef struct _XmLGridRowRec *XmLGridRow;
|
||||
typedef struct _XmLGridColumnRec *XmLGridColumn;
|
||||
typedef struct _XmLGridCellRec *XmLGridCell;
|
||||
|
||||
#define XmLIsGrid(w) XtIsSubclass((w), xmlGridWidgetClass)
|
||||
|
||||
Widget XmLCreateGrid(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
void XmLGridAddColumns(Widget w, unsigned char type, int position, int count);
|
||||
void XmLGridAddRows(Widget w, unsigned char type, int position, int count);
|
||||
Boolean XmLGridColumnIsVisible(Widget w, int column);
|
||||
Boolean XmLGridCopyPos(Widget w, Time time, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, int nrow, int ncolumn);
|
||||
Boolean XmLGridCopySelected(Widget w, Time time);
|
||||
void XmLGridDeleteAllColumns(Widget w, unsigned char type);
|
||||
void XmLGridDeleteAllRows(Widget w, unsigned char type);
|
||||
void XmLGridDeleteColumns(Widget w, unsigned char type, int position,
|
||||
int count);
|
||||
void XmLGridDeleteRows(Widget w, unsigned char type, int position, int count);
|
||||
void XmLGridDeselectAllCells(Widget w, Boolean notify);
|
||||
void XmLGridDeselectAllColumns(Widget w, Boolean notify);
|
||||
void XmLGridDeselectAllRows(Widget w, Boolean notify);
|
||||
void XmLGridDeselectCell(Widget w, int row, int column, Boolean notify);
|
||||
void XmLGridDeselectColumn(Widget w, int column, Boolean notify);
|
||||
void XmLGridDeselectRow(Widget w, int row, Boolean notify);
|
||||
int XmLGridEditBegin(Widget w, Boolean insert, int row, int column);
|
||||
void XmLGridEditCancel(Widget w);
|
||||
void XmLGridEditComplete(Widget w);
|
||||
XmLGridColumn XmLGridGetColumn(Widget w, unsigned char columnType, int column);
|
||||
void XmLGridGetFocus(Widget w, int *row, int *column, Boolean *focusIn);
|
||||
XmLGridRow XmLGridGetRow(Widget w, unsigned char rowType, int row);
|
||||
int XmLGridGetSelectedCellCount(Widget w);
|
||||
int XmLGridGetSelectedCells(Widget w, int *rowPositions,
|
||||
int *columnPositions, int count);
|
||||
int XmLGridGetSelectedColumnCount(Widget w);
|
||||
int XmLGridGetSelectedColumns(Widget w, int *positions, int count);
|
||||
int XmLGridGetSelectedRow(Widget w);
|
||||
int XmLGridGetSelectedRowCount(Widget w);
|
||||
int XmLGridGetSelectedRows(Widget w, int *positions, int count);
|
||||
void XmLGridMoveColumns(Widget w, int newPosition, int position, int count);
|
||||
void XmLGridMoveRows(Widget w, int newPosition, int position, int count);
|
||||
Boolean XmLGridPaste(Widget w);
|
||||
Boolean XmLGridPastePos(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column);
|
||||
int XmLGridRead(Widget w, FILE *file, int format, char delimiter);
|
||||
int XmLGridReadPos(Widget w, FILE *file, int format, char delimiter,
|
||||
unsigned char rowType, int row, unsigned char columnType, int column);
|
||||
void XmLGridRedrawAll(Widget w);
|
||||
void XmLGridRedrawCell(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column);
|
||||
void XmLGridRedrawColumn(Widget w, unsigned char type, int column);
|
||||
void XmLGridRedrawRow(Widget w, unsigned char type, int row);
|
||||
void XmLGridReorderColumns(Widget w, int *newPositions,
|
||||
int position, int count);
|
||||
void XmLGridReorderRows(Widget w, int *newPositions,
|
||||
int position, int count);
|
||||
int XmLGridRowColumnToXY(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, Boolean clipped, XRectangle *rect);
|
||||
Boolean XmLGridRowIsVisible(Widget w, int row);
|
||||
void XmLGridSelectAllCells(Widget w, Boolean notify);
|
||||
void XmLGridSelectAllColumns(Widget w, Boolean notify);
|
||||
void XmLGridSelectAllRows(Widget w, Boolean notify);
|
||||
void XmLGridSelectCell(Widget w, int row, int column, Boolean notify);
|
||||
void XmLGridSelectColumn(Widget w, int column, Boolean notify);
|
||||
void XmLGridSelectRow(Widget w, int row, Boolean notify);
|
||||
int XmLGridSetFocus(Widget w, int row, int column);
|
||||
int XmLGridSetStrings(Widget w, char *data);
|
||||
int XmLGridSetStringsPos(Widget w, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, char *data);
|
||||
int XmLGridWrite(Widget w, FILE *file, int format, char delimiter,
|
||||
Boolean skipHidden);
|
||||
int XmLGridWritePos(Widget w, FILE *file, int format, char delimiter,
|
||||
Boolean skipHidden, unsigned char rowType, int row,
|
||||
unsigned char columnType, int column, int nrow, int ncolumn);
|
||||
int XmLGridXYToRowColumn(Widget w, int x, int y, unsigned char *rowType,
|
||||
int *row, unsigned char *columnType, int *column);
|
||||
|
||||
int XmLGridPosIsResize(Widget g, int x, int y);
|
||||
|
||||
void XmLGridSetVisibleColumnCount(Widget w, int num_visible);
|
||||
void XmLGridHideRightColumn(Widget w);
|
||||
void XmLGridUnhideRightColumn(Widget w);
|
||||
|
||||
int XmLGridGetRowCount(Widget w);
|
||||
int XmLGridGetColumnCount(Widget w);
|
||||
|
||||
/* extern */ void
|
||||
XmLGridXYToCellTracking(Widget widget,
|
||||
int x, /* input only args. */
|
||||
int y, /* input only args. */
|
||||
Boolean * m_inGrid, /* input/output args. */
|
||||
int * m_lastRow, /* input/output args. */
|
||||
int * m_lastCol, /* input/output args. */
|
||||
unsigned char * m_lastRowtype,/* input/output args. */
|
||||
unsigned char * m_lastColtype,/* input/output args. */
|
||||
int * outRow, /* output only args. */
|
||||
int * outCol, /* output only args. */
|
||||
Boolean * enter, /* output only args. */
|
||||
Boolean * leave); /* output only args. */
|
||||
|
||||
void XmLGridGetSort(Widget w, int *column, unsigned char *sortType);
|
||||
void XmLGridSetSort(Widget w, int column, unsigned char sortType);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,475 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLGridPH
|
||||
#define XmLGridPH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef MOTIF11
|
||||
#include <Xm/ManagerP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
#include <Xm/DragC.h>
|
||||
#include <Xm/DropTrans.h>
|
||||
#endif
|
||||
|
||||
#include "Grid.h"
|
||||
|
||||
#ifdef XmL_ANSIC
|
||||
|
||||
void _XmLGridLayout(XmLGridWidget g);
|
||||
|
||||
void _XmLGridCellDrawBackground(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
void _XmLGridCellDrawBorders(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
void _XmLGridCellDrawValue(XmLGridCell cell, Widget w,
|
||||
XRectangle *clipRect, XmLGridDrawStruct *ds);
|
||||
typedef int (*XmLGridPreLayoutProc)(XmLGridWidget g, int isVert);
|
||||
|
||||
typedef XmLGridRow (*XmLGridRowNewProc)(Widget grid);
|
||||
typedef void (*XmLGridRowFreeProc)(XmLGridRow);
|
||||
typedef void (*XmLGridGetRowValueMaskProc)(XmLGridWidget g,
|
||||
char *s, long *mask);
|
||||
typedef void (*XmLGridGetRowValueProc)(XmLGridWidget g, XmLGridRow row,
|
||||
XtArgVal value, long mask);
|
||||
typedef int (*XmLGridSetRowValuesProc)(XmLGridWidget g,
|
||||
XmLGridRow row, long mask);
|
||||
|
||||
typedef XmLGridColumn (*XmLGridColumnNewProc)(Widget grid);
|
||||
typedef void (*XmLGridColumnFreeProc)(XmLGridColumn);
|
||||
typedef void (*XmLGridGetColumnValueMaskProc)(XmLGridWidget g,
|
||||
char *s, long *mask);
|
||||
typedef void (*XmLGridGetColumnValueProc)(XmLGridWidget g, XmLGridColumn col,
|
||||
XtArgVal value, long mask);
|
||||
typedef int (*XmLGridSetColumnValuesProc)(XmLGridWidget g,
|
||||
XmLGridColumn col, long mask);
|
||||
|
||||
typedef int (*XmLGridSetCellValuesResizeProc)(XmLGridWidget g,
|
||||
XmLGridRow row, XmLGridColumn col, XmLGridCell cell, long mask);
|
||||
typedef int (*XmLGridCellActionProc)(XmLGridCell, Widget,
|
||||
XmLGridCallbackStruct *);
|
||||
|
||||
#else
|
||||
|
||||
void _XmLGridLayout();
|
||||
|
||||
void _XmLGridCellDrawBackground();
|
||||
void _XmLGridCellDrawBorders();
|
||||
void _XmLGridCellDrawValue();
|
||||
typedef int (*XmLGridPreLayoutProc)();
|
||||
|
||||
typedef XmLGridRow (*XmLGridRowNewProc)();
|
||||
typedef void (*XmLGridRowFreeProc)() ;
|
||||
typedef void (*XmLGridGetRowValueMaskProc)();
|
||||
typedef void (*XmLGridGetRowValueProc)();
|
||||
typedef int (*XmLGridSetRowValuesProc)();
|
||||
|
||||
typedef XmLGridColumn (*XmLGridColumnNewProc)() ;
|
||||
typedef void (*XmLGridColumnFreeProc)() ;
|
||||
typedef void (*XmLGridGetColumnValueMaskProc)();
|
||||
typedef void (*XmLGridGetColumnValueProc)();
|
||||
typedef int (*XmLGridSetColumnValuesProc)();
|
||||
|
||||
typedef int (*XmLGridSetCellValuesResizeProc)();
|
||||
typedef int (*XmLGridCellActionProc)();
|
||||
|
||||
#endif
|
||||
|
||||
#define XmLGridClassPartOfWidget(w) \
|
||||
((XmLGridWidgetClass)XtClass(w))->grid_class
|
||||
|
||||
#define XmInheritGridPreLayout ((XmLGridPreLayoutProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridRowNew ((XmLGridRowNewProc)_XtInherit)
|
||||
#define XmInheritGridRowFree ((XmLGridRowFreeProc)_XtInherit)
|
||||
#define XmInheritGridGetRowValueMask ((XmLGridGetRowValueMaskProc)_XtInherit)
|
||||
#define XmInheritGridGetRowValue ((XmLGridGetRowValueProc)_XtInherit)
|
||||
#define XmInheritGridSetRowValues ((XmLGridSetRowValuesProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridColumnNew ((XmLGridColumnNewProc)_XtInherit)
|
||||
#define XmInheritGridColumnFree ((XmLGridColumnFreeProc)_XtInherit)
|
||||
#define XmInheritGridGetColumnValueMask \
|
||||
((XmLGridGetColumnValueMaskProc)_XtInherit)
|
||||
#define XmInheritGridGetColumnValue ((XmLGridGetColumnValueProc)_XtInherit)
|
||||
#define XmInheritGridSetColumnValues ((XmLGridSetColumnValuesProc)_XtInherit)
|
||||
|
||||
#define XmInheritGridSetCellValuesResize \
|
||||
((XmLGridSetCellValuesResizeProc)_XtInherit)
|
||||
#define XmInheritGridCellAction ((XmLGridCellActionProc)_XtInherit)
|
||||
|
||||
/* row value mask for get/set values */
|
||||
#define XmLGridRowHeight (1L<<0)
|
||||
#define XmLGridRowSizePolicy (1L<<1)
|
||||
#define XmLGridRowUserData (1L<<2)
|
||||
#define XmLGridRowValueMaskLen 3
|
||||
|
||||
/* column value mask for get/set values */
|
||||
#define XmLGridColumnWidth (1L<<0)
|
||||
#define XmLGridColumnSizePolicy (1L<<1)
|
||||
#define XmLGridColumnUserData (1L<<2)
|
||||
#define XmLGridColumnResizable (1L<<3)
|
||||
#define XmLGridColumnHidden (1L<<4)
|
||||
#define XmLGridColumnSortType (1L<<5)
|
||||
#define XmLGridColumnValueMaskLen 6
|
||||
|
||||
/* flags for XmLGridCell flags member */
|
||||
#define XmLGridCellSelectedFlag (1 << 0)
|
||||
#define XmLGridCellValueSetFlag (1 << 1)
|
||||
#define XmLGridCellInRowSpanFlag (1 << 2)
|
||||
#define XmLGridCellInColumnSpanFlag (1 << 3)
|
||||
#define XmLGridCellDrawSortFlag (1 << 4)
|
||||
#define XmLGridCellSortAscendingFlag (1 << 5)
|
||||
|
||||
/* cell value mask for get/set values */
|
||||
#define XmLGridCellAlignment (1L<<0)
|
||||
#define XmLGridCellBackground (1L<<1)
|
||||
#define XmLGridCellBottomBorderColor (1L<<2)
|
||||
#define XmLGridCellBottomBorderType (1L<<3)
|
||||
#define XmLGridCellColumnSpan (1L<<4)
|
||||
#define XmLGridCellEditable (1L<<5)
|
||||
#define XmLGridCellFontList (1L<<6)
|
||||
#define XmLGridCellForeground (1L<<7)
|
||||
#define XmLGridCellLeftBorderColor (1L<<8)
|
||||
#define XmLGridCellLeftBorderType (1L<<9)
|
||||
#define XmLGridCellMarginBottom (1L<<10)
|
||||
#define XmLGridCellMarginLeft (1L<<11)
|
||||
#define XmLGridCellMarginRight (1L<<12)
|
||||
#define XmLGridCellMarginTop (1L<<13)
|
||||
#define XmLGridCellPixmapF (1L<<14)
|
||||
#define XmLGridCellPixmapMask (1L<<15)
|
||||
#define XmLGridCellRightBorderColor (1L<<16)
|
||||
#define XmLGridCellRightBorderType (1L<<17)
|
||||
#define XmLGridCellRowSpan (1L<<18)
|
||||
#define XmLGridCellString (1L<<19)
|
||||
#define XmLGridCellToggleSet (1L<<20)
|
||||
#define XmLGridCellTopBorderColor (1L<<21)
|
||||
#define XmLGridCellTopBorderType (1L<<22)
|
||||
#define XmLGridCellType (1L<<23)
|
||||
#define XmLGridCellUserData (1L<<24)
|
||||
|
||||
/* This is now a resource */
|
||||
/* #define XmLICON_SPACING 4 */
|
||||
|
||||
enum { DrawAll, DrawHScroll, DrawVScroll, DrawRow, DrawCol, DrawCell };
|
||||
enum { SelectRow, SelectCol, SelectCell };
|
||||
enum { CursorNormal, CursorHResize, CursorVResize };
|
||||
enum { InNormal, InSelect, InResize, InMove };
|
||||
enum { DragLeft = 1, DragRight = 2, DragUp = 4, DragDown = 8 };
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x, y, width, height;
|
||||
int row, col, nrow, ncol;
|
||||
} GridReg;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int row, col;
|
||||
} GridDropLoc;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char alignment;
|
||||
Pixel background;
|
||||
Pixel bottomBorderColor;
|
||||
char bottomBorderType;
|
||||
Dimension bottomMargin;
|
||||
int columnSpan;
|
||||
Boolean editable;
|
||||
short fontHeight;
|
||||
XmFontList fontList;
|
||||
short fontWidth;
|
||||
Pixel foreground;
|
||||
Pixel leftBorderColor;
|
||||
char leftBorderType;
|
||||
Dimension leftMargin;
|
||||
int refCount;
|
||||
Pixel rightBorderColor;
|
||||
char rightBorderType;
|
||||
Dimension rightMargin;
|
||||
int rowSpan;
|
||||
Pixel topBorderColor;
|
||||
char topBorderType;
|
||||
Dimension topMargin;
|
||||
unsigned char type;
|
||||
void *userData;
|
||||
} XmLGridCellRefValues;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Pixmap pixmap, pixmask;
|
||||
Dimension width, height;
|
||||
} XmLGridCellPixmap;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
XmString string;
|
||||
XmLGridCellPixmap pix;
|
||||
} XmLGridCellIcon;
|
||||
|
||||
typedef struct _XmLGridCellPart
|
||||
{
|
||||
XmLGridCellRefValues *refValues;
|
||||
unsigned char flags;
|
||||
void *value;
|
||||
} XmLGridCellPart;
|
||||
|
||||
struct _XmLGridCellRec
|
||||
{
|
||||
XmLGridCellPart cell;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridRowPart
|
||||
{
|
||||
int pos; /* required first for Array autonumber */
|
||||
Dimension height;
|
||||
unsigned char sizePolicy;
|
||||
Boolean selected;
|
||||
XtPointer userData;
|
||||
Dimension heightInPixels;
|
||||
unsigned int heightInPixelsValid:1;
|
||||
Widget grid;
|
||||
int visPos;
|
||||
XmLArray cellArray;
|
||||
} XmLGridRowPart;
|
||||
|
||||
struct _XmLGridRowRec
|
||||
{
|
||||
XmLGridRowPart grid;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridColumnPart
|
||||
{
|
||||
int pos; /* required first for Array autonumber */
|
||||
Dimension width;
|
||||
unsigned char sizePolicy;
|
||||
Boolean selected;
|
||||
XtPointer userData;
|
||||
XmLGridCellRefValues *defCellValues;
|
||||
Widget grid;
|
||||
Dimension widthInPixels;
|
||||
unsigned int widthInPixelsValid:1;
|
||||
Boolean resizable;
|
||||
int visPos;
|
||||
|
||||
/* xfe additions */
|
||||
Boolean hidden;
|
||||
unsigned char sort;
|
||||
} XmLGridColumnPart;
|
||||
|
||||
struct _XmLGridColumnRec
|
||||
{
|
||||
XmLGridColumnPart grid;
|
||||
};
|
||||
|
||||
typedef struct _XmLGridPart
|
||||
{
|
||||
/* resource values */
|
||||
int leftFixedCount, rightFixedCount;
|
||||
int headingRowCount, footerRowCount;
|
||||
int topFixedCount, bottomFixedCount;
|
||||
int headingColCount, footerColCount;
|
||||
Dimension leftFixedMargin, rightFixedMargin;
|
||||
Dimension topFixedMargin, bottomFixedMargin;
|
||||
Dimension scrollBarMargin;
|
||||
Dimension highlightThickness;
|
||||
Dimension toggleSize;
|
||||
Dimension globalPixmapWidth, globalPixmapHeight;
|
||||
unsigned char selectionPolicy;
|
||||
Boolean layoutFrozen, immediateDraw;
|
||||
int debugLevel;
|
||||
unsigned char vsPolicy, hsPolicy;
|
||||
unsigned char hsbDisplayPolicy, vsbDisplayPolicy;
|
||||
int rowCount, colCount;
|
||||
int hiddenRowCount, hiddenColCount;
|
||||
int shadowRegions;
|
||||
unsigned char shadowType;
|
||||
Widget hsb, vsb, text;
|
||||
XmFontList fontList;
|
||||
Pixel blankBg, selectBg, selectFg;
|
||||
Pixel defaultCellBg, defaultCellFg;
|
||||
Pixel toggleTopColor, toggleBotColor;
|
||||
int visibleCols, visibleRows;
|
||||
char *simpleHeadings, *simpleWidths;
|
||||
XtTranslations editTrans, traverseTrans;
|
||||
Boolean allowRowHide, allowColHide;
|
||||
Boolean allowRowResize, allowColResize;
|
||||
Boolean allowDrag, allowDrop;
|
||||
Boolean autoSelect;
|
||||
Boolean highlightRowMode;
|
||||
Boolean useAvgWidth;
|
||||
int scrollRow, scrollCol, cScrollRow, cScrollCol;
|
||||
XtCallbackList addCallback, deleteCallback;
|
||||
XtCallbackList cellDrawCallback, cellFocusCallback;
|
||||
XtCallbackList cellDropCallback, cellPasteCallback;
|
||||
XtCallbackList activateCallback, editCallback;
|
||||
XtCallbackList selectCallback, deselectCallback;
|
||||
XtCallbackList resizeCallback, scrollCallback;
|
||||
|
||||
XtCallbackList enterCellCallback;
|
||||
XtCallbackList leaveCellCallback;
|
||||
XtCallbackList enterGridCallback;
|
||||
XtCallbackList leaveGridCallback;
|
||||
|
||||
/* XFE Additions */
|
||||
XtCallbackList popupCallback;
|
||||
Boolean hideUnhideButtons;
|
||||
Boolean singleClickActivation;
|
||||
Widget hideButton;
|
||||
Widget unhideButton;
|
||||
XtTranslations hideButtonTrans;
|
||||
XtTranslations unhideButtonTrans;
|
||||
|
||||
Boolean inResize;
|
||||
|
||||
Boolean useTextWidget;
|
||||
|
||||
Dimension iconSpacing;
|
||||
|
||||
Dimension minColWidth;
|
||||
|
||||
int lastCursorMotionRow;
|
||||
int lastCursorMotionCol;
|
||||
|
||||
unsigned char colSortType;
|
||||
|
||||
/* private data */
|
||||
GC gc;
|
||||
Cursor hResizeCursor, vResizeCursor;
|
||||
XFontStruct *fallbackFont;
|
||||
char ignoreModifyVerify;
|
||||
char focusIn, inEdit, inMode;
|
||||
char singleColScrollMode;
|
||||
int singleColScrollPos;
|
||||
char cursorDefined, textHidden, resizeIsVert;
|
||||
char mayHaveRowSpans;
|
||||
int layoutStack;
|
||||
char needsHorizLayout, needsVertLayout;
|
||||
char recalcHorizVisPos, recalcVertVisPos;
|
||||
char vertVisChangedHint;
|
||||
char dragTimerSet;
|
||||
XtIntervalId dragTimerId;
|
||||
int resizeRow, resizeCol, resizeLineXY;
|
||||
int extendRow, extendCol, extendToRow, extendToCol;
|
||||
Boolean extendSelect;
|
||||
int lastSelectRow, lastSelectCol;
|
||||
Time lastSelectTime;
|
||||
int focusRow, focusCol;
|
||||
XmLArray rowArray;
|
||||
XmLArray colArray;
|
||||
GridReg reg[9];
|
||||
GridDropLoc dropLoc;
|
||||
|
||||
/* resources use by SetSubValues and GetSubValues */
|
||||
Boolean cellDefaults;
|
||||
int cellRow, cellCol;
|
||||
int cellColRangeStart, cellColRangeEnd;
|
||||
int cellRowRangeStart, cellRowRangeEnd;
|
||||
int rowStep, colStep;
|
||||
unsigned char rowType, colType;
|
||||
Boolean colHidden;
|
||||
|
||||
/* cell resources */
|
||||
XmString cellString;
|
||||
Boolean cellToggleSet;
|
||||
Pixmap cellPixmap, cellPixmapMask;
|
||||
Dimension cellPixmapWidth, cellPixmapHeight;
|
||||
XmLGridCellRefValues cellValues, *defCellValues;
|
||||
|
||||
/* row resources */
|
||||
Dimension rowHeight;
|
||||
unsigned char rowSizePolicy;
|
||||
Boolean rowSelected;
|
||||
XtPointer rowUserData;
|
||||
|
||||
/* column resources */
|
||||
Dimension colWidth;
|
||||
unsigned char colSizePolicy;
|
||||
Boolean colSelected;
|
||||
XtPointer colUserData;
|
||||
Boolean colResizable;
|
||||
|
||||
/* xfe additions */
|
||||
/* Edit timer is used for inplace editing */
|
||||
char editTimerSet;
|
||||
XtIntervalId editTimerId;
|
||||
} XmLGridPart;
|
||||
|
||||
typedef struct _XmLGridRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmLGridPart grid;
|
||||
} XmLGridRec;
|
||||
|
||||
typedef struct _XmLGridClassPart
|
||||
{
|
||||
int initialRows;
|
||||
int initialCols;
|
||||
XmLGridPreLayoutProc preLayoutProc;
|
||||
int rowRecSize;
|
||||
XmLGridRowNewProc rowNewProc;
|
||||
XmLGridRowFreeProc rowFreeProc;
|
||||
XmLGridGetRowValueMaskProc getRowValueMaskProc;
|
||||
XmLGridGetRowValueProc getRowValueProc;
|
||||
XmLGridSetRowValuesProc setRowValuesProc;
|
||||
int columnRecSize;
|
||||
XmLGridColumnNewProc columnNewProc;
|
||||
XmLGridColumnFreeProc columnFreeProc;
|
||||
XmLGridGetColumnValueMaskProc getColumnValueMaskProc;
|
||||
XmLGridGetColumnValueProc getColumnValueProc;
|
||||
XmLGridSetColumnValuesProc setColumnValuesProc;
|
||||
XmLGridSetCellValuesResizeProc setCellValuesResizeProc;
|
||||
XmLGridCellActionProc cellActionProc;
|
||||
} XmLGridClassPart;
|
||||
|
||||
typedef struct _XmLGridClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmLGridClassPart grid_class;
|
||||
} XmLGridClassRec;
|
||||
|
||||
extern XmLGridClassRec xmlGridClassRec;
|
||||
|
||||
typedef struct _XmLGridConstraintPart
|
||||
{
|
||||
int unused;
|
||||
} XmLGridConstraintPart;
|
||||
|
||||
typedef struct _XmLGridConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager;
|
||||
XmLGridConstraintPart grid;
|
||||
} XmLGridConstraintRec, *XmLGridConstraintPtr;
|
||||
|
||||
#endif
|
||||
@@ -1,151 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* */
|
||||
/* Name: <XmL/GridUtil.c> */
|
||||
/* */
|
||||
/* Description: XmLGrid misc utilities. They are here in order not to */
|
||||
/* continue bloating Grid.c beyond hope. */
|
||||
/* */
|
||||
/* Author: Ramiro Estrugo <ramiro@netscape.com> */
|
||||
/* */
|
||||
/* Created: Thu May 28 21:55:45 PDT 1998 */
|
||||
/* */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
#include "GridP.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* extern */ int
|
||||
XmLGridGetRowCount(Widget w)
|
||||
{
|
||||
XmLGridWidget g = (XmLGridWidget) w;
|
||||
|
||||
assert( g != NULL );
|
||||
|
||||
#ifdef DEBUG_ramiro
|
||||
{
|
||||
int rows = 0;
|
||||
|
||||
XtVaGetValues(w,XmNrows,&rows,NULL);
|
||||
|
||||
assert( rows == g->grid.rowCount );
|
||||
}
|
||||
#endif
|
||||
|
||||
return g->grid.rowCount;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* extern */ int
|
||||
XmLGridGetColumnCount(Widget w)
|
||||
{
|
||||
XmLGridWidget g = (XmLGridWidget) w;
|
||||
|
||||
assert( g != NULL );
|
||||
|
||||
#ifdef DEBUG_ramiro
|
||||
{
|
||||
int columns = 0;
|
||||
|
||||
XtVaGetValues(w,XmNcolumns,&columns,NULL);
|
||||
|
||||
assert( columns == g->grid.colCount );
|
||||
}
|
||||
#endif
|
||||
|
||||
return g->grid.colCount;
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* extern */ void
|
||||
XmLGridXYToCellTracking(Widget widget,
|
||||
int x, /* input only args. */
|
||||
int y, /* input only args. */
|
||||
Boolean * m_inGrid, /* input/output args. */
|
||||
int * m_lastRow, /* input/output args. */
|
||||
int * m_lastCol, /* input/output args. */
|
||||
unsigned char * m_lastRowtype, /* input/output args. */
|
||||
unsigned char * m_lastColtype,/* input/output args. */
|
||||
int * outRow, /* output only args. */
|
||||
int * outCol, /* output only args. */
|
||||
Boolean * enter, /* output only args. */
|
||||
Boolean * leave) /* output only args. */
|
||||
{
|
||||
int m_totalLines = 0;
|
||||
int m_numcolumns = 0;
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
unsigned char rowtype = XmCONTENT;
|
||||
unsigned char coltype = XmCONTENT;
|
||||
|
||||
if (0 > XmLGridXYToRowColumn(widget,
|
||||
x,
|
||||
y,
|
||||
&rowtype,
|
||||
&row,
|
||||
&coltype,
|
||||
&column))
|
||||
{
|
||||
/* In grid; but, not in any cells
|
||||
*/
|
||||
/* treat it as a leave
|
||||
*/
|
||||
*enter = FALSE;
|
||||
*leave = TRUE;
|
||||
return;
|
||||
}/* if */
|
||||
|
||||
m_totalLines = XmLGridGetRowCount(widget);
|
||||
m_numcolumns = XmLGridGetColumnCount(widget);
|
||||
|
||||
if ((row < m_totalLines) &&
|
||||
(column < m_numcolumns) &&
|
||||
((*m_lastRow != row)||
|
||||
(*m_lastCol != column) ||
|
||||
(*m_lastRowtype != rowtype)||
|
||||
(*m_lastColtype != coltype)))
|
||||
{
|
||||
*outRow = (rowtype == XmHEADING)?-1:row;
|
||||
*outCol = column;
|
||||
|
||||
if (*m_inGrid == False)
|
||||
{
|
||||
*m_inGrid = True;
|
||||
|
||||
/* enter a cell
|
||||
*/
|
||||
*enter = TRUE;
|
||||
*leave = FALSE;
|
||||
|
||||
}/* if */
|
||||
else
|
||||
{
|
||||
/* Cruising among cells
|
||||
*/
|
||||
*enter = TRUE;
|
||||
*leave = TRUE;
|
||||
}/* else */
|
||||
*m_lastRow = row;
|
||||
*m_lastCol = column;
|
||||
*m_lastRowtype = rowtype ;
|
||||
*m_lastColtype = coltype ;
|
||||
}/* row /col in grid */
|
||||
}
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -1,82 +0,0 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# Name: Makefile
|
||||
# Description: Makefile for Microline Widget library
|
||||
# Author: Ramiro Estrugo <ramiro@netscape.com>
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
DEPTH = ../../../..
|
||||
|
||||
# XmL headers are exported to dist/public/Microline/XmL
|
||||
MODULE = Microline/XmL
|
||||
|
||||
LIBRARY_NAME = XmL
|
||||
|
||||
# There are unused widgets. They are currently not needed to build Mozilla,
|
||||
# but that might change in the future.
|
||||
ifdef XFE_WIDGETS_BUILD_UNUSED
|
||||
|
||||
XFE_EXTRA_DEFINES += -DXFE_WIDGETS_BUILD_UNUSED
|
||||
|
||||
UNUSED_CSRCS = \
|
||||
Progress.c \
|
||||
$(NULL)
|
||||
|
||||
UNUSED_EXPORTS = \
|
||||
Progress.h \
|
||||
ProgressP.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
CSRCS = \
|
||||
$(UNUSED_CSRCS) \
|
||||
Folder.c \
|
||||
Grid.c \
|
||||
GridUtil.c \
|
||||
Tree.c \
|
||||
XmL.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = Microline
|
||||
|
||||
EXPORTS = \
|
||||
$(UNUSED_EXPORTS) \
|
||||
Folder.h \
|
||||
FolderP.h \
|
||||
Grid.h \
|
||||
GridP.h \
|
||||
Tree.h \
|
||||
TreeP.h \
|
||||
XmL.h \
|
||||
$(NULL)
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
DEFINES += $(XFE_EXTRA_DEFINES)
|
||||
@@ -1,89 +0,0 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# The following source code is part of the Microline Widget Library.
|
||||
# The Microline widget library is made available to Mozilla developers
|
||||
# under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
# more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
# http://www.neurondata.com.
|
||||
#
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# Name: Makefile
|
||||
# Description: Makefile for Microline Widget library
|
||||
# Author: Ramiro Estrugo <ramiro@netscape.com>
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
# XmL headers are exported to dist/public/Microline/XmL
|
||||
MODULE = Microline/XmL
|
||||
|
||||
LIBRARY_NAME = XmL
|
||||
|
||||
# There are unused widgets. They are currently not needed to build Mozilla,
|
||||
# but that might change in the future.
|
||||
ifdef XFE_WIDGETS_BUILD_UNUSED
|
||||
|
||||
XFE_EXTRA_DEFINES += -DXFE_WIDGETS_BUILD_UNUSED
|
||||
|
||||
UNUSED_CSRCS = \
|
||||
Progress.c \
|
||||
$(NULL)
|
||||
|
||||
UNUSED_EXPORTS = \
|
||||
Progress.h \
|
||||
ProgressP.h \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
CSRCS = \
|
||||
$(UNUSED_CSRCS) \
|
||||
Folder.c \
|
||||
Grid.c \
|
||||
GridUtil.c \
|
||||
Tree.c \
|
||||
XmL.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = Microline
|
||||
|
||||
EXPORTS = \
|
||||
$(UNUSED_EXPORTS) \
|
||||
Folder.h \
|
||||
FolderP.h \
|
||||
Grid.h \
|
||||
GridP.h \
|
||||
Tree.h \
|
||||
TreeP.h \
|
||||
XmL.h \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += $(XFE_EXTRA_DEFINES)
|
||||
@@ -1,601 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
#include "ProgressP.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static void ClassInitialize(void);
|
||||
static void Initialize(Widget , Widget, ArgList, Cardinal *);
|
||||
static void Resize(Widget);
|
||||
static void Destroy(Widget);
|
||||
static void Realize(Widget w, XtValueMask *valueMask,
|
||||
XSetWindowAttributes *attr);
|
||||
static void Redisplay(Widget, XEvent *, Region);
|
||||
static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *);
|
||||
static void CopyFontList(XmLProgressWidget p);
|
||||
static void TimeStr(char *, int);
|
||||
static void DrawBarMeter(XmLProgressWidget p, XRectangle *rect);
|
||||
static void DrawBoxesMeter(XmLProgressWidget p, XRectangle *rect);
|
||||
static void DrawString(XmLProgressWidget, XmString, int, int,
|
||||
int, XRectangle *, XRectangle *);
|
||||
static Boolean CvtStringToMeterStyle(Display *dpy, XrmValuePtr args,
|
||||
Cardinal *numArgs, XrmValuePtr fromVal, XrmValuePtr toVal,
|
||||
XtPointer *data);
|
||||
|
||||
static XtResource resources[] =
|
||||
{
|
||||
{
|
||||
XmNcompleteValue, XmCCompleteValue,
|
||||
XtRInt, sizeof(int),
|
||||
XtOffset(XmLProgressWidget, progress.completeValue),
|
||||
XtRImmediate, (caddr_t)100
|
||||
},
|
||||
{
|
||||
XmNnumBoxes, XmCNumBoxes,
|
||||
XtRInt, sizeof(int),
|
||||
XtOffset(XmLProgressWidget, progress.numBoxes),
|
||||
XtRImmediate, (caddr_t)10
|
||||
},
|
||||
{
|
||||
XmNvalue, XmCValue,
|
||||
XtRInt, sizeof(int),
|
||||
XtOffset(XmLProgressWidget, progress.value),
|
||||
XtRImmediate, (caddr_t)0
|
||||
},
|
||||
{
|
||||
XmNfontList, XmCFontList,
|
||||
XmRFontList, sizeof(XmFontList),
|
||||
XtOffset(XmLProgressWidget, progress.fontList),
|
||||
XmRImmediate, (XtPointer)0,
|
||||
},
|
||||
{
|
||||
XmNmeterStyle, XmCMeterStyle,
|
||||
XmRMeterStyle, sizeof(unsigned char),
|
||||
XtOffset(XmLProgressWidget, progress.meterStyle),
|
||||
XmRImmediate, (XtPointer)XmMETER_BAR,
|
||||
},
|
||||
{
|
||||
XmNshowTime, XmCShowTime,
|
||||
XmRBoolean, sizeof(Boolean),
|
||||
XtOffset(XmLProgressWidget, progress.showTime),
|
||||
XmRImmediate, (XtPointer)False
|
||||
},
|
||||
{
|
||||
XmNshowPercentage, XmCShowPercentage,
|
||||
XmRBoolean, sizeof(Boolean),
|
||||
XtOffset(XmLProgressWidget, progress.showPercentage),
|
||||
XmRImmediate, (XtPointer)True
|
||||
}
|
||||
};
|
||||
|
||||
XmLProgressClassRec xmlProgressClassRec =
|
||||
{
|
||||
{ /* Core */
|
||||
(WidgetClass)&xmPrimitiveClassRec, /* superclass */
|
||||
"XmLProgress", /* class_name */
|
||||
sizeof(XmLProgressRec), /* widget_size */
|
||||
ClassInitialize, /* class_initialize */
|
||||
NULL, /* class_part_initialize */
|
||||
FALSE, /* class_inited */
|
||||
(XtInitProc)Initialize, /* initialize */
|
||||
NULL, /* initialize_hook */
|
||||
(XtRealizeProc)Realize, /* realize */
|
||||
NULL, /* actions */
|
||||
0, /* num_actions */
|
||||
resources, /* resources */
|
||||
XtNumber(resources), /* num_resources */
|
||||
NULLQUARK, /* xrm_class */
|
||||
TRUE, /* compress_motion */
|
||||
FALSE, /* compress_exposure */
|
||||
TRUE, /* compress_enterleave */
|
||||
TRUE, /* visible_interest */
|
||||
(XtWidgetProc)Destroy, /* destroy */
|
||||
(XtWidgetProc)Resize, /* resize */
|
||||
(XtExposeProc)Redisplay, /* expose */
|
||||
(XtSetValuesFunc)SetValues, /* set_values */
|
||||
NULL, /* set_values_hook */
|
||||
XtInheritSetValuesAlmost, /* set_values_almost */
|
||||
NULL, /* get_values_hook */
|
||||
NULL, /* accept_focus */
|
||||
XtVersion, /* version */
|
||||
NULL, /* callback_private */
|
||||
XtInheritTranslations, /* tm_table */
|
||||
NULL, /* query_geometry */
|
||||
NULL, /* display_accelerator */
|
||||
NULL, /* extension */
|
||||
},
|
||||
{ /* Primitive */
|
||||
(XtWidgetProc)_XtInherit, /* border_highlight */
|
||||
(XtWidgetProc)_XtInherit, /* border_unhighlight */
|
||||
XtInheritTranslations, /* translations */
|
||||
NULL, /* arm_and_activate */
|
||||
NULL, /* syn_resources */
|
||||
0, /* num_syn_resources */
|
||||
NULL, /* extension */
|
||||
},
|
||||
{ /* Progress */
|
||||
0, /* unused */
|
||||
}
|
||||
};
|
||||
|
||||
WidgetClass xmlProgressWidgetClass = (WidgetClass)&xmlProgressClassRec;
|
||||
|
||||
static void
|
||||
ClassInitialize(void)
|
||||
{
|
||||
XmLInitialize();
|
||||
|
||||
XtSetTypeConverter(XmRString, XmRMeterStyle, CvtStringToMeterStyle,
|
||||
0, 0, XtCacheNone, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
Initialize(Widget reqW,
|
||||
Widget newW,
|
||||
ArgList args,
|
||||
Cardinal *narg)
|
||||
{
|
||||
XmLProgressWidget p;
|
||||
|
||||
p = (XmLProgressWidget)newW;
|
||||
|
||||
if (!p->core.width)
|
||||
p->core.width = 200;
|
||||
if (!p->core.height)
|
||||
p->core.height = 30;
|
||||
|
||||
p->progress.gc = 0;
|
||||
p->progress.startTime = time(0);
|
||||
CopyFontList(p);
|
||||
if (p->progress.completeValue < 1)
|
||||
{
|
||||
XmLWarning(newW, "Initialize() - complete value can't be < 1");
|
||||
p->progress.completeValue = 1;
|
||||
}
|
||||
if (p->progress.numBoxes < 1)
|
||||
{
|
||||
XmLWarning(newW, "Initialize() - number of boxes can't be < 1");
|
||||
p->progress.numBoxes = 1;
|
||||
}
|
||||
if (p->progress.value < 0)
|
||||
{
|
||||
XmLWarning(newW, "Initialize() - value can't be < 0");
|
||||
p->progress.value = 0;
|
||||
}
|
||||
if (p->progress.value > p->progress.completeValue)
|
||||
{
|
||||
XmLWarning(newW, "Initialize() - value can't be > completeValue");
|
||||
p->progress.value = p->progress.completeValue;
|
||||
}
|
||||
XtVaSetValues(newW, XmNtraversalOn, False, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
Resize(Widget w)
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
|
||||
if (!XtIsRealized(w))
|
||||
return;
|
||||
dpy = XtDisplay(w);
|
||||
win = XtWindow(w);
|
||||
XClearArea(dpy, win, 0, 0, 0, 0, True);
|
||||
}
|
||||
|
||||
static void
|
||||
Destroy(Widget w)
|
||||
{
|
||||
Display *dpy;
|
||||
XmLProgressWidget p;
|
||||
|
||||
p = (XmLProgressWidget)w;
|
||||
dpy = XtDisplay(w);
|
||||
if (p->progress.gc)
|
||||
{
|
||||
XFreeGC(dpy, p->progress.gc);
|
||||
XFreeFont(dpy, p->progress.fallbackFont);
|
||||
}
|
||||
XmFontListFree(p->progress.fontList);
|
||||
}
|
||||
|
||||
static void
|
||||
Realize(Widget w,
|
||||
XtValueMask *valueMask,
|
||||
XSetWindowAttributes *attr)
|
||||
{
|
||||
XmLProgressWidget p;
|
||||
Display *dpy;
|
||||
WidgetClass superClass;
|
||||
XtRealizeProc realize;
|
||||
XGCValues values;
|
||||
/* XtGCMask mask;*/
|
||||
|
||||
p = (XmLProgressWidget)w;
|
||||
dpy = XtDisplay(p);
|
||||
superClass = xmlProgressWidgetClass->core_class.superclass;
|
||||
realize = superClass->core_class.realize;
|
||||
(*realize)(w, valueMask, attr);
|
||||
|
||||
if (!p->progress.gc)
|
||||
{
|
||||
p->progress.fallbackFont = XLoadQueryFont(dpy, "fixed");
|
||||
values.font = p->progress.fallbackFont->fid;
|
||||
p->progress.gc = XCreateGC(dpy, XtWindow(p), GCFont, &values);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
Redisplay(Widget w,
|
||||
XEvent *event,
|
||||
Region region)
|
||||
{
|
||||
XmLProgressWidget p;
|
||||
Display *dpy;
|
||||
Window win;
|
||||
XRectangle rect;
|
||||
int st;
|
||||
|
||||
if (!XtIsRealized(w) || !w->core.visible)
|
||||
return;
|
||||
|
||||
p = (XmLProgressWidget)w;
|
||||
dpy = XtDisplay(w);
|
||||
win = XtWindow(w);
|
||||
st = p->primitive.shadow_thickness;
|
||||
rect.x = st;
|
||||
rect.y = st;
|
||||
rect.width = p->core.width - st * 2;
|
||||
rect.height = p->core.height - st * 2;
|
||||
|
||||
if (p->progress.meterStyle == XmMETER_BAR)
|
||||
DrawBarMeter(p, &rect);
|
||||
else if (p->progress.meterStyle == XmMETER_BOXES)
|
||||
DrawBoxesMeter(p, &rect);
|
||||
|
||||
#ifdef MOTIF11
|
||||
_XmDrawShadow(dpy, win,
|
||||
p->primitive.bottom_shadow_GC,
|
||||
p->primitive.top_shadow_GC,
|
||||
p->primitive.shadow_thickness,
|
||||
0, 0, p->core.width, p->core.height);
|
||||
#else
|
||||
_XmDrawShadows(dpy, win,
|
||||
p->primitive.top_shadow_GC,
|
||||
p->primitive.bottom_shadow_GC,
|
||||
0, 0, p->core.width, p->core.height,
|
||||
p->primitive.shadow_thickness,
|
||||
XmSHADOW_IN);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
DrawBoxesMeter(XmLProgressWidget p,
|
||||
XRectangle *rect)
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
int i, j, st, nb, x1, x2;
|
||||
|
||||
dpy = XtDisplay(p);
|
||||
win = XtWindow(p);
|
||||
st = p->primitive.shadow_thickness;
|
||||
nb = p->progress.numBoxes;
|
||||
if (nb * st * 2 > (int)rect->width)
|
||||
return;
|
||||
|
||||
if (p->progress.completeValue)
|
||||
j = (int)((long)nb * (long)p->progress.value /
|
||||
(long)p->progress.completeValue);
|
||||
else
|
||||
j = 0;
|
||||
x2 = 0;
|
||||
for (i = 0; i < nb; i++)
|
||||
{
|
||||
if (i < j)
|
||||
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
|
||||
else
|
||||
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
|
||||
x1 = x2;
|
||||
if (i == nb - 1)
|
||||
x2 = rect->width;
|
||||
else
|
||||
x2 = ((int)rect->width * (i + 1)) / nb;
|
||||
XFillRectangle(dpy, win, p->progress.gc,
|
||||
rect->x + x1 + st, rect->y + st,
|
||||
x2 - x1 - st * 2, rect->height - st * 2);
|
||||
#ifdef MOTIF11
|
||||
_XmDrawShadow(dpy, win,
|
||||
p->primitive.bottom_shadow_GC,
|
||||
p->primitive.top_shadow_GC,
|
||||
p->primitive.shadow_thickness,
|
||||
rect->x + x1, rect->y,
|
||||
x2 - x1, rect->height);
|
||||
#else
|
||||
_XmDrawShadows(dpy, win,
|
||||
p->primitive.top_shadow_GC,
|
||||
p->primitive.bottom_shadow_GC,
|
||||
rect->x + x1, rect->y,
|
||||
x2 - x1, rect->height,
|
||||
p->primitive.shadow_thickness,
|
||||
XmSHADOW_IN);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DrawBarMeter(XmLProgressWidget p,
|
||||
XRectangle *rect)
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
int timeLeft, timeSoFar;
|
||||
time_t currentTime;
|
||||
XmString str;
|
||||
Dimension strWidth, strHeight;
|
||||
XRectangle lRect, rRect;
|
||||
int percent;
|
||||
char c[10];
|
||||
long l;
|
||||
|
||||
dpy = XtDisplay(p);
|
||||
win = XtWindow(p);
|
||||
|
||||
/* Left Rect */
|
||||
if (p->progress.completeValue)
|
||||
l = (long)rect->width * (long)p->progress.value /
|
||||
(long)p->progress.completeValue;
|
||||
else
|
||||
l = 0;
|
||||
lRect.x = rect->x;
|
||||
lRect.y = rect->y;
|
||||
lRect.width = (Dimension)l;
|
||||
lRect.height = rect->height;
|
||||
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
|
||||
XFillRectangle(dpy, win, p->progress.gc, lRect.x, lRect.y,
|
||||
lRect.width, lRect.height);
|
||||
|
||||
/* Right Rect */
|
||||
rRect.x = rect->x + (int)l;
|
||||
rRect.y = rect->y;
|
||||
rRect.width = rect->width - (Dimension)l;
|
||||
rRect.height = rect->height;
|
||||
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
|
||||
XFillRectangle(dpy, win, p->progress.gc, rRect.x, rRect.y,
|
||||
rRect.width, rRect.height);
|
||||
|
||||
if (p->progress.completeValue)
|
||||
percent = (int)(((long)p->progress.value * 100) /
|
||||
(long)p->progress.completeValue);
|
||||
else
|
||||
percent = 0;
|
||||
|
||||
/* percent complete */
|
||||
sprintf(c, "%d%c", percent, '%');
|
||||
str = XmStringCreateSimple(c);
|
||||
XmStringExtent(p->progress.fontList, str, &strWidth, &strHeight);
|
||||
if (p->progress.showPercentage)
|
||||
DrawString(p, str, rect->x + rect->width / 2 - (int)strWidth / 2,
|
||||
rect->y + rect->height / 2 - (int)strHeight / 2, strWidth,
|
||||
&lRect, &rRect);
|
||||
XmStringFree(str);
|
||||
|
||||
/* Left Time */
|
||||
currentTime = time(0);
|
||||
timeSoFar = (int)(currentTime - p->progress.startTime);
|
||||
if (p->progress.showTime && p->progress.value &&
|
||||
p->progress.value != p->progress.completeValue && timeSoFar)
|
||||
{
|
||||
TimeStr(c, timeSoFar);
|
||||
str = XmStringCreateSimple(c);
|
||||
XmStringExtent(p->progress.fontList, str,
|
||||
&strWidth, &strHeight);
|
||||
DrawString(p, str, rect->x + 5, rect->y + rect->height / 2 -
|
||||
(int)strHeight / 2, strWidth, &lRect, &rRect);
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
/* Right Time */
|
||||
timeLeft = 0;
|
||||
if (percent)
|
||||
timeLeft = (timeSoFar * 100 / percent) - timeSoFar;
|
||||
if (p->progress.showTime && percent && percent != 100 && timeLeft)
|
||||
{
|
||||
TimeStr(c, timeLeft);
|
||||
str = XmStringCreateSimple(c);
|
||||
XmStringExtent(p->progress.fontList, str,
|
||||
&strWidth, &strHeight);
|
||||
DrawString(p, str, rect->x + rect->width - strWidth - 5,
|
||||
rect->y + rect->height / 2 - (int)strHeight / 2,
|
||||
strWidth, &lRect, &rRect);
|
||||
XmStringFree(str);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
DrawString(XmLProgressWidget p,
|
||||
XmString str,
|
||||
int x,
|
||||
int y,
|
||||
int strWidth,
|
||||
XRectangle *lRect,
|
||||
XRectangle *rRect)
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
|
||||
dpy = XtDisplay(p);
|
||||
win = XtWindow(p);
|
||||
if (lRect->width && lRect->height)
|
||||
{
|
||||
XSetForeground(dpy, p->progress.gc, p->core.background_pixel);
|
||||
XSetClipRectangles(dpy, p->progress.gc, 0, 0, lRect, 1, Unsorted);
|
||||
XmStringDraw(dpy, win, p->progress.fontList, str,
|
||||
p->progress.gc, x, y, strWidth, XmALIGNMENT_BEGINNING,
|
||||
XmSTRING_DIRECTION_L_TO_R, 0);
|
||||
XSetClipMask(dpy, p->progress.gc, None);
|
||||
}
|
||||
if (rRect->width && rRect->height)
|
||||
{
|
||||
XSetForeground(dpy, p->progress.gc, p->primitive.foreground);
|
||||
XSetClipRectangles(dpy, p->progress.gc, 0, 0, rRect, 1, Unsorted);
|
||||
XmStringDraw(dpy, win, p->progress.fontList, str,
|
||||
p->progress.gc, x, y, strWidth, XmALIGNMENT_BEGINNING,
|
||||
XmSTRING_DIRECTION_L_TO_R, 0);
|
||||
XSetClipMask(dpy, p->progress.gc, None);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
TimeStr(char *c,
|
||||
int seconds)
|
||||
{
|
||||
int h, m, s;
|
||||
|
||||
s = seconds;
|
||||
m = s / 60;
|
||||
s -= m * 60;
|
||||
h = m / 60;
|
||||
m -= h * 60;
|
||||
if (h > 99)
|
||||
h = 99;
|
||||
if (h > 0 && m < 10)
|
||||
sprintf(c, "%d:0%d hr", h, m);
|
||||
else if (h > 0)
|
||||
sprintf(c, "%d:%d hr", h, m);
|
||||
else if (m > 0 && s < 10)
|
||||
sprintf(c, "%d:0%d min", m, s);
|
||||
else if (m > 0)
|
||||
sprintf(c, "%d:%d min", m, s);
|
||||
else
|
||||
sprintf(c, "%d sec", s);
|
||||
}
|
||||
|
||||
static Boolean
|
||||
SetValues(Widget curW,
|
||||
Widget reqW,
|
||||
Widget newW,
|
||||
ArgList args,
|
||||
Cardinal *narg)
|
||||
{
|
||||
XmLProgressWidget cur, p;
|
||||
XtAppContext app;
|
||||
|
||||
cur = (XmLProgressWidget)curW;
|
||||
p = (XmLProgressWidget)newW;
|
||||
app = XtWidgetToApplicationContext(curW);
|
||||
if (p->progress.value == 0)
|
||||
p->progress.startTime = time(0);
|
||||
if (p->progress.completeValue < 1)
|
||||
{
|
||||
XmLWarning(newW, "SetValues() - complete value can't be < 1");
|
||||
p->progress.completeValue = 1;
|
||||
}
|
||||
if (p->progress.numBoxes < 1)
|
||||
{
|
||||
XmLWarning(newW, "SetValues() - number of boxes can't be < 1");
|
||||
p->progress.numBoxes = 1;
|
||||
}
|
||||
if (p->progress.value < 0)
|
||||
{
|
||||
XmLWarning(newW, "SetValues() - value can't be < 0");
|
||||
p->progress.value = 0;
|
||||
}
|
||||
if (p->progress.value > p->progress.completeValue)
|
||||
{
|
||||
XmLWarning(newW, "SetValues() - value can't be > completeValue");
|
||||
p->progress.value = p->progress.completeValue;
|
||||
}
|
||||
if (p->progress.fontList != cur->progress.fontList)
|
||||
{
|
||||
XmFontListFree(cur->progress.fontList);
|
||||
CopyFontList(p);
|
||||
}
|
||||
/* display changes immediately since we may be not get back
|
||||
to XNextEvent if the calling application is computing */
|
||||
if (p->core.background_pixel != cur->core.background_pixel ||
|
||||
p->primitive.foreground != cur->primitive.foreground ||
|
||||
p->progress.value != cur->progress.value ||
|
||||
p->progress.completeValue != cur->progress.completeValue ||
|
||||
p->progress.fontList != cur->progress.fontList ||
|
||||
p->progress.showTime != cur->progress.showTime ||
|
||||
p->progress.showPercentage != cur->progress.showPercentage ||
|
||||
p->progress.meterStyle != cur->progress.meterStyle ||
|
||||
p->progress.numBoxes != cur->progress.numBoxes ||
|
||||
p->primitive.shadow_thickness != cur->primitive.shadow_thickness)
|
||||
{
|
||||
Redisplay(newW, 0, 0);
|
||||
XFlush(XtDisplay(newW));
|
||||
XmUpdateDisplay(newW);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
CopyFontList(XmLProgressWidget p)
|
||||
{
|
||||
if (!p->progress.fontList)
|
||||
p->progress.fontList = XmLFontListCopyDefault((Widget)p);
|
||||
else
|
||||
p->progress.fontList = XmFontListCopy(p->progress.fontList);
|
||||
if (!p->progress.fontList)
|
||||
XmLWarning((Widget)p, "- fatal error - font list NULL");
|
||||
}
|
||||
|
||||
static Boolean
|
||||
CvtStringToMeterStyle(Display *dpy,
|
||||
XrmValuePtr args,
|
||||
Cardinal *narg,
|
||||
XrmValuePtr fromVal,
|
||||
XrmValuePtr toVal,
|
||||
XtPointer *data)
|
||||
{
|
||||
static XmLStringToUCharMap map[] =
|
||||
{
|
||||
{ "METER_BAR", XmMETER_BAR },
|
||||
{ "METER_BOXES", XmMETER_BOXES },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
return XmLCvtStringToUChar(dpy, "XmRMeterStyle", map, fromVal, toVal);
|
||||
}
|
||||
|
||||
/*
|
||||
Public Functions
|
||||
*/
|
||||
|
||||
Widget
|
||||
XmLCreateProgress(Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount)
|
||||
{
|
||||
return XtCreateWidget(name, xmlProgressWidgetClass, parent,
|
||||
arglist, argcount);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLProgressH
|
||||
#define XmLProgressH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlProgressWidgetClass;
|
||||
typedef struct _XmLProgressClassRec *XmLProgressWidgetClass;
|
||||
typedef struct _XmLProgressRec *XmLProgressWidget;
|
||||
|
||||
#define XmLIsProgress(w) XtIsSubclass((w), xmlProgressWidgetClass)
|
||||
|
||||
#ifdef XmL_ANSIC
|
||||
|
||||
Widget XmLCreateProgress(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
#else
|
||||
|
||||
Widget XmLCreateProgress();
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,76 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLProgressPH
|
||||
#define XmLProgressPH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <X11/StringDefs.h>
|
||||
#ifdef MOTIF11
|
||||
#else
|
||||
#include <Xm/PrimitiveP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "Progress.h"
|
||||
|
||||
typedef struct _XmLProgressPart
|
||||
{
|
||||
int completeValue, value;
|
||||
Boolean showTime;
|
||||
Boolean showPercentage;
|
||||
XmFontList fontList;
|
||||
GC gc;
|
||||
time_t startTime;
|
||||
XFontStruct *fallbackFont;
|
||||
unsigned char meterStyle;
|
||||
int numBoxes;
|
||||
} XmLProgressPart;
|
||||
|
||||
typedef struct _XmLProgressRec
|
||||
{
|
||||
CorePart core;
|
||||
XmPrimitivePart primitive;
|
||||
XmLProgressPart progress;
|
||||
} XmLProgressRec;
|
||||
|
||||
typedef struct _XmLProgressClassPart
|
||||
{
|
||||
int null;
|
||||
} XmLProgressClassPart;
|
||||
|
||||
typedef struct _XmLProgressClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
XmPrimitiveClassPart primitive_class;
|
||||
XmLProgressClassPart progress_class;
|
||||
} XmLProgressClassRec;
|
||||
|
||||
extern XmLProgressClassRec xmlProgressClassRec;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,56 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLTreeH
|
||||
#define XmLTreeH
|
||||
|
||||
#include <XmL/XmL.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern WidgetClass xmlTreeWidgetClass;
|
||||
typedef struct _XmLTreeClassRec *XmLTreeWidgetClass;
|
||||
typedef struct _XmLTreeRec *XmLTreeWidget;
|
||||
typedef struct _XmLTreeRowRec *XmLTreeRow;
|
||||
|
||||
#define XmLIsTree(w) XtIsSubclass((w), xmlTreeWidgetClass)
|
||||
|
||||
Widget XmLCreateTree(Widget parent, char *name, ArgList arglist,
|
||||
Cardinal argcount);
|
||||
void XmLTreeAddRow(Widget w, int level, Boolean expands, Boolean isExpaned,
|
||||
int position, Pixmap pixmap, Pixmap pixmask, XmString string);
|
||||
void XmLTreeAddRows(Widget w, XmLTreeRowDefinition *rows,
|
||||
int count, int position);
|
||||
void XmLTreeDeleteChildren(Widget w, int position);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,125 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLTreePH
|
||||
#define XmLTreePH
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#ifndef MOTIF11
|
||||
#include <Xm/ManagerP.h>
|
||||
#include <Xm/DrawP.h>
|
||||
#endif
|
||||
|
||||
#include "Tree.h"
|
||||
#include "GridP.h"
|
||||
|
||||
/* row value mask for get/set values */
|
||||
#define RVML XmLGridRowValueMaskLen
|
||||
#define XmLTreeRowLevel (1L << (RVML))
|
||||
#define XmLTreeRowExpands (1L << (RVML + 1))
|
||||
#define XmLTreeRowIsExpanded (1L << (RVML + 2))
|
||||
|
||||
typedef struct _XmLTreeRowPart
|
||||
{
|
||||
Boolean expands;
|
||||
int level;
|
||||
Boolean hasChildren, hasSiblings, isExpanded;
|
||||
Dimension stringWidth;
|
||||
Boolean stringWidthValid;
|
||||
} XmLTreeRowPart;
|
||||
|
||||
struct _XmLTreeRowRec
|
||||
{
|
||||
XmLGridRowPart grid;
|
||||
XmLTreeRowPart tree;
|
||||
};
|
||||
|
||||
typedef struct _XmLTreePart
|
||||
{
|
||||
/* resources */
|
||||
Dimension levelSpacing;
|
||||
Pixel lineColor, pmColor;
|
||||
XtCallbackList collapseCallback, expandCallback;
|
||||
|
||||
/* private data */
|
||||
char *linesData;
|
||||
int linesSize, linesMaxLevel;
|
||||
int recalcTreeWidth;
|
||||
|
||||
char defaultPixmapsCreated;
|
||||
Pixel pixColors[4];
|
||||
Pixmap filePixmask, folderPixmask, folderOpenPixmask;
|
||||
Pixmap filePixmap, folderPixmap, folderOpenPixmap;
|
||||
|
||||
/* row resources */
|
||||
int rowLevel;
|
||||
Boolean rowExpands, rowIsExpanded;
|
||||
|
||||
/* Causes the tree to NOT render any pixmaps */
|
||||
Boolean ignorePixmaps;
|
||||
} XmLTreePart;
|
||||
|
||||
typedef struct _XmLTreeRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmLGridPart grid;
|
||||
XmLTreePart tree;
|
||||
} XmLTreeRec;
|
||||
|
||||
typedef struct _XmLTreeClassPart
|
||||
{
|
||||
int unused;
|
||||
} XmLTreeClassPart;
|
||||
|
||||
typedef struct _XmLTreeClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmLGridClassPart grid_class;
|
||||
XmLTreeClassPart tree_class;
|
||||
} XmLTreeClassRec;
|
||||
|
||||
extern XmLTreeClassRec xmlTreeClassRec;
|
||||
|
||||
typedef struct _XmLTreeConstraintPart
|
||||
{
|
||||
int unused;
|
||||
} XmLTreeConstraintPart;
|
||||
|
||||
typedef struct _XmLTreeConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager;
|
||||
XmLGridConstraintPart grid;
|
||||
XmLTreeConstraintPart tree;
|
||||
} XmLTreeConstraintRec, *XmLTreeConstraintPtr;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,658 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XmLH
|
||||
#define XmLH
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
#define XmL_CPP 1
|
||||
#endif
|
||||
|
||||
#if defined(_STDC_) || defined(__STDC__) || defined(XmL_CPP)
|
||||
#ifndef _NO_PROTO
|
||||
#define XmL_ANSIC 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define XmLVERSION_301
|
||||
|
||||
#ifdef XmL_CPP
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* shared resources */
|
||||
|
||||
#define XmNautoSelect "autoSelect"
|
||||
#define XmCAutoSelect "AutoSelect"
|
||||
#define XmNblankBackground "blankBackground"
|
||||
#define XmCBlankBackground "BlankBackground"
|
||||
#define XmNdebugLevel "debugLevel"
|
||||
#define XmCDebugLevel "DebugLevel"
|
||||
|
||||
/* Folder resources */
|
||||
|
||||
#define XmNacceptResize "acceptResize"
|
||||
#define XmCAcceptResize "AcceptResize"
|
||||
#define XmNactiveTab "activeTab"
|
||||
#define XmCActiveTab "ActiveTab"
|
||||
#define XmNblankBackgroundPixmap "blankBackgroundPixmap"
|
||||
#define XmCBlankBackgroundPixmap "BlankBackgroundPixmap"
|
||||
#define XmNcornerDimension "cornerDimension"
|
||||
#define XmCCornerDimension "CornerDimension"
|
||||
#define XmNcornerStyle "cornerStyle"
|
||||
#define XmCCornerStyle "CornerStyle"
|
||||
#define XmRCornerStyle "CornerStyle"
|
||||
#define XmNinactiveBackground "inactiveBackground"
|
||||
#define XmCInactiveBackground "InactiveBackground"
|
||||
#define XmNinactiveForeground "inactiveForeground"
|
||||
#define XmCInactiveForeground "InactiveForeground"
|
||||
#define XmNpixmapMargin "pixmapMargin"
|
||||
#define XmCPixmapMargin "PixmapMargin"
|
||||
#define XmCFolderResizePolicy "FolderResizePolicy"
|
||||
#define XmRFolderResizePolicy "FolderResizePolicy"
|
||||
#define XmNrotateWhenLeftRight "rotateWhenLeftRight"
|
||||
#define XmCRotateWhenLeftRight "RotateWhenLeftRight"
|
||||
#define XmNtabBarHeight "tabBarHeight"
|
||||
#define XmCTabBarHeight "TabBarHeight"
|
||||
#define XmNtabCount "tabCount"
|
||||
#define XmCTabCount "TabCount"
|
||||
#define XmNtabPlacement "tabPlacement"
|
||||
#define XmCTabPlacement "TabPlacement"
|
||||
#define XmRTabPlacement "TabPlacement"
|
||||
#define XmNtabsPerRow "tabsPerRow"
|
||||
#define XmCTabsPerRow "TabsPerRow"
|
||||
#define XmNtabTranslations "tabTranslations"
|
||||
#define XmNtabWidgetList "tabWidgetList"
|
||||
#define XmNtabWidgetClass "tabWidgetClass"
|
||||
#define XmCTabWidgetClass "TabWidgetClass"
|
||||
|
||||
/* Folder Constraint resources */
|
||||
|
||||
#define XmNtabFreePixmaps "tabFreePixmaps"
|
||||
#define XmCTabFreePixmaps "TabFreePixmaps"
|
||||
#define XmNtabInactivePixmap "tabInactivePixmap"
|
||||
#define XmCTabInactivePixmap "TabInactivePixmap"
|
||||
#define XmNtabManagedName "tabManagedName"
|
||||
#define XmCTabManagedName "TabManagedName"
|
||||
#define XmNtabManagedWidget "tabManagedWidget"
|
||||
#define XmCTabManagedWidget "TabManagedWidget"
|
||||
#define XmNtabPixmap "tabPixmap"
|
||||
#define XmCTabPixmap "TabPixmap"
|
||||
|
||||
/* Folder callbacks */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int reason;
|
||||
XEvent *event;
|
||||
int pos;
|
||||
int allowActivate;
|
||||
int layoutNeeded;
|
||||
} XmLFolderCallbackStruct;
|
||||
|
||||
/* Folder defines */
|
||||
|
||||
#define XmCORNER_NONE 0
|
||||
#define XmCORNER_LINE 1
|
||||
#define XmCORNER_ARC 2
|
||||
|
||||
#define XmFOLDER_TOP 0
|
||||
#define XmFOLDER_LEFT 1
|
||||
#define XmFOLDER_BOTTOM 2
|
||||
#define XmFOLDER_RIGHT 3
|
||||
|
||||
#define XmRESIZE_STATIC 10
|
||||
#define XmRESIZE_DYNAMIC 11
|
||||
|
||||
/* Grid resources */
|
||||
|
||||
#define XmNaddCallback "addCallback"
|
||||
#define XmNallowColumnHide "allowColumnHide"
|
||||
#define XmCAllowColumnHide "AllowColumnHide"
|
||||
#define XmNallowColumnResize "allowColumnResize"
|
||||
#define XmCAllowColumnResize "AllowColumnResize"
|
||||
#define XmNallowDragSelected "allowDragSelected"
|
||||
#define XmCAllowDragSelected "AllowDragSelected"
|
||||
#define XmNallowDrop "allowDrop"
|
||||
#define XmCAllowDrop "AllowDrop"
|
||||
#define XmNallowRowHide "allowRowHide"
|
||||
#define XmCAllowRowHide "AllowRowHide"
|
||||
#define XmNallowRowResize "allowRowResize"
|
||||
#define XmCAllowRowResize "AllowRowResize"
|
||||
#define XmNbottomFixedCount "bottomFixedCount"
|
||||
#define XmCBottomFixedCount "BottomFixedCount"
|
||||
#define XmNbottomFixedMargin "bottomFixedMargin"
|
||||
#define XmCBottomFixedMargin "BottomFixedMargin"
|
||||
#define XmNcellDefaults "cellDefaults"
|
||||
#define XmCCellDefaults "CellDefaults"
|
||||
#define XmNcellDrawCallback "cellDrawCallback"
|
||||
#define XmNcellDropCallback "cellDropCallback"
|
||||
#define XmNcellFocusCallback "cellFocusCallback"
|
||||
#define XmNcellPasteCallback "cellPasteCallback"
|
||||
#define XmNdeleteCallback "deleteCallback"
|
||||
#define XmNdeselectCallback "deselectCallback"
|
||||
#define XmNeditCallback "editCallback"
|
||||
#define XmNeditTranslations "editTranslations"
|
||||
#define XmNfooterColumns "footerColumns"
|
||||
#define XmCFooterColumns "FooterColumns"
|
||||
#define XmNfooterRows "footerRows"
|
||||
#define XmCFooterRows "FooterRows"
|
||||
#define XmNglobalPixmapHeight "globalPixmapHeight"
|
||||
#define XmCGlobalPixmapHeight "GlobalPixmapHeight"
|
||||
#define XmNglobalPixmapWidth "globalPixmapWidth"
|
||||
#define XmCGlobalPixmapWidth "GlobalPixmapWidth"
|
||||
#define XmCGridSelectionPolicy "GridSelectionPolicy"
|
||||
#define XmRGridSelectionPolicy "GridSelectionPolicy"
|
||||
#define XmRGridSizePolicy "GridSizePolicy"
|
||||
#define XmNheadingColumns "headingColumns"
|
||||
#define XmCHeadingColumns "HeadingColumns"
|
||||
#define XmNheadingRows "headingRows"
|
||||
#define XmCHeadingRows "HeadingRows"
|
||||
#define XmNhiddenColumns "hiddenColumns"
|
||||
#define XmCHiddenColumns "HiddenColumns"
|
||||
#define XmNhiddenRows "hiddenRows"
|
||||
#define XmCHiddenRows "HiddenRows"
|
||||
#define XmNhighlightRowMode "highlightRowMode"
|
||||
#define XmCHighlightRowMode "HighlightRowMode"
|
||||
#define XmNhorizontalSizePolicy "horizontalSizePolicy"
|
||||
#define XmCHorizontalSizePolicy "HorizontalSizePolicy"
|
||||
#define XmNhsbDisplayPolicy "hsbDisplayPolicy"
|
||||
#define XmCHsbDisplayPolicy "HsbDisplayPolicy"
|
||||
#define XmNimmediateDraw "immediateDraw"
|
||||
#define XmCImmediateDraw "ImmediateDraw"
|
||||
#define XmNlayoutFrozen "layoutFrozen"
|
||||
#define XmCLayoutFrozen "LayoutFrozen"
|
||||
#define XmNleftFixedCount "leftFixedCount"
|
||||
#define XmCLeftFixedCount "LeftFixedCount"
|
||||
#define XmNleftFixedMargin "leftFixedMargin"
|
||||
#define XmCLeftFixedMargin "LeftFixedMargin"
|
||||
#define XmNrightFixedCount "rightFixedCount"
|
||||
#define XmCRightFixedCount "RightFixedCount"
|
||||
#define XmNrightFixedMargin "rightFixedMargin"
|
||||
#define XmCRightFixedMargin "RightFixedMargin"
|
||||
#define XmNscrollBarMargin "scrollBarMargin"
|
||||
#define XmCScrollBarMargin "ScrollBarMargin"
|
||||
#define XmNscrollCallback "scrollCallback"
|
||||
#define XmNscrollColumn "scrollColumn"
|
||||
#define XmCScrollColumn "ScrollColumn"
|
||||
#define XmNscrollRow "scrollRow"
|
||||
#define XmCScrollRow "ScrollRow"
|
||||
#define XmNsimpleHeadings "simpleHeadings"
|
||||
#define XmCSimpleHeadings "SimpleHeadings"
|
||||
#define XmNsimpleWidths "simpleWidths"
|
||||
#define XmCSimpleWidths "SimpleWidths"
|
||||
#define XmNselectCallback "selectCallback"
|
||||
#define XmNselectForeground "selectForeground"
|
||||
#define XmCSelectForeground "SelectForeground"
|
||||
#define XmNselectBackground "selectBackground"
|
||||
#define XmCSelectBackground "SelectBackground"
|
||||
#define XmNshadowRegions "shadowRegions"
|
||||
#define XmCShadowRegions "ShadowRegions"
|
||||
#define XmNtextWidget "textWidget"
|
||||
#define XmCTextWidget "TextWidget"
|
||||
#define XmNtoggleTopColor "toggleTopColor"
|
||||
#define XmCToggleTopColor "ToggleTopColor"
|
||||
#define XmNtoggleBottomColor "toggleBottomColor"
|
||||
#define XmCToggleBottomColor "ToggleBottomColor"
|
||||
#define XmNtoggleSize "toggleSize"
|
||||
#define XmCToggleSize "ToggleSize"
|
||||
#define XmNtopFixedCount "topFixedCount"
|
||||
#define XmCTopFixedCount "TopFixedCount"
|
||||
#define XmNtopFixedMargin "topFixedMargin"
|
||||
#define XmCTopFixedMargin "TopFixedMargin"
|
||||
#define XmNtraverseTranslations "traverseTranslations"
|
||||
#define XmNuseAverageFontWidth "useAverageFontWidth"
|
||||
#define XmCUseAverageFontWidth "UseAverageFontWidth"
|
||||
#define XmNverticalSizePolicy "verticalSizePolicy"
|
||||
#define XmCVerticalSizePolicy "VerticalSizePolicy"
|
||||
#define XmNvisibleColumns "visibleColumns"
|
||||
#define XmCVisibleColumns "VisibleColumns"
|
||||
#define XmNvisibleRows "visibleRows"
|
||||
#define XmCVisibleRows "VisibleRows"
|
||||
#define XmNvsbDisplayPolicy "vsbDisplayPolicy"
|
||||
#define XmCVsbDisplayPolicy "VsbDisplayPolicy"
|
||||
#define XmNiconSpacing "iconSpacing"
|
||||
#define XmCIconSpacing "IconSpacing"
|
||||
|
||||
|
||||
/* XFE Additions */
|
||||
#define XmNhideUnhideButtons "hideUnhideButtons"
|
||||
#define XmCHideUnhideButtons "HideUnhideButtons"
|
||||
#define XmNsingleClickActivation "singleClickActivation"
|
||||
#define XmCSingleClickActivation "SingleClickActivation"
|
||||
#define XmNuseTextWidget "useTextWidget"
|
||||
#define XmCUseTextWidget "UseTextWidget"
|
||||
#define XmNcolumnSortType "columnSortType"
|
||||
#define XmCColumnSortType "ColumnSortType"
|
||||
#define XmRColumnSortType "ColumnSortType"
|
||||
#if 0
|
||||
#define XmNhideButtonTranslations "hideButtonTranslations"
|
||||
#define XmNunhideButtonTranslations "unhideButtonTranslations"
|
||||
#endif /*0*/
|
||||
#define XmNminColumnWidth "minColumnWidth"
|
||||
#define XmCMinColumnWidth "MinColumnWidth"
|
||||
|
||||
#define XmNenterCellCallback "enterCellCallback"
|
||||
#define XmNleaveCellCallback "leaveCellCallback"
|
||||
|
||||
#define XmNenterGridCallback "enterGridCallback"
|
||||
#define XmNleaveGridCallback "leaveGridCallback"
|
||||
|
||||
/* Grid Row/Column/Cell resources */
|
||||
|
||||
#define XmNrow "row"
|
||||
#define XmCGridRow "row"
|
||||
#define XmNrowHeight "rowHeight"
|
||||
#define XmCRowHeight "RowHeight"
|
||||
#define XmNrowPtr "rowPtr"
|
||||
#define XmNrowRangeEnd "rowRangeEnd"
|
||||
#define XmCRowRangeEnd "RowRangeEnd"
|
||||
#define XmNrowRangeStart "rowRangeStart"
|
||||
#define XmCRowRangeStart "RowRangeStart"
|
||||
#define XmNrowSizePolicy "rowSizePolicy"
|
||||
#define XmCRowSizePolicy "RowSizePolicy"
|
||||
#define XmNrowStep "rowStep"
|
||||
#define XmCRowStep "RowStep"
|
||||
#define XmNrowType "rowType"
|
||||
#define XmCRowType "RowType"
|
||||
#define XmRRowType "RowType"
|
||||
#define XmNrowUserData "rowUserData"
|
||||
|
||||
#define XmNcolumn "column"
|
||||
#define XmCGridColumn "Column"
|
||||
#define XmNcolumnPtr "columnPtr"
|
||||
#define XmNcolumnRangeEnd "columnRangeEnd"
|
||||
#define XmCColumnRangeEnd "ColumnRangeEnd"
|
||||
#define XmNcolumnRangeStart "columnRangeStart"
|
||||
#define XmCColumnRangeStart "ColumnRangeStart"
|
||||
#define XmNcolumnResizable "columnResizable"
|
||||
#define XmCColumnResizable "ColumnResizable"
|
||||
#define XmNcolumnSizePolicy "columnSizePolicy"
|
||||
#define XmCColumnSizePolicy "ColumnSizePolicy"
|
||||
#define XmNcolumnHidden "columnHidden"
|
||||
#define XmCColumnHidden "ColumnHidden"
|
||||
#define XmNcolumnStep "columnStep"
|
||||
#define XmCColumnStep "ColumnStep"
|
||||
#define XmNcolumnType "columnType"
|
||||
#define XmCColumnType "ColumnType"
|
||||
#define XmRColumnType "ColumnType"
|
||||
#define XmNcolumnWidth "columnWidth"
|
||||
#define XmCColumnWidth "ColumnWidth"
|
||||
#define XmNcolumnUserData "columnUserData"
|
||||
|
||||
#define XmNcellAlignment "cellAlignment"
|
||||
#define XmCCellAlignment "CellAlignment"
|
||||
#define XmRCellAlignment "CellAlignment"
|
||||
#define XmNcellBackground "cellBackground"
|
||||
#define XmCCellBackground "CellBackground"
|
||||
#define XmRCellBorderType "CellBorderType"
|
||||
#define XmNcellBottomBorderType "cellBottomBorderType"
|
||||
#define XmCCellBottomBorderType "CellBottomBorderType"
|
||||
#define XmNcellBottomBorderColor "cellBottomBorderColor"
|
||||
#define XmCCellBottomBorderColor "CellBottomBorderColor"
|
||||
#define XmNcellColumnSpan "cellColumnSpan"
|
||||
#define XmCCellColumnSpan "CellColumnSpan"
|
||||
#define XmNcellEditable "cellEditable"
|
||||
#define XmCCellEditable "CellEditable"
|
||||
#define XmNcellForeground "cellForeground"
|
||||
#define XmCCellForeground "CellForeground"
|
||||
#define XmNcellFontList "cellFontList"
|
||||
#define XmCCellFontList "CellFontList"
|
||||
#define XmNcellLeftBorderType "cellLeftBorderType"
|
||||
#define XmCCellLeftBorderType "CellLeftBorderType"
|
||||
#define XmNcellLeftBorderColor "cellLeftBorderColor"
|
||||
#define XmCCellLeftBorderColor "CellLeftBorderColor"
|
||||
#define XmNcellMarginBottom "cellMarginBottom"
|
||||
#define XmCCellMarginBottom "CellMarginBottom"
|
||||
#define XmNcellMarginLeft "cellMarginLeft"
|
||||
#define XmCCellMarginLeft "CellMarginLeft"
|
||||
#define XmNcellMarginRight "cellMarginRight"
|
||||
#define XmCCellMarginRight "CellMarginRight"
|
||||
#define XmNcellMarginTop "cellMarginTop"
|
||||
#define XmCCellMarginTop "CellMarginTop"
|
||||
#define XmNcellPixmap "cellPixmap"
|
||||
#define XmCCellPixmap "CellPixmap"
|
||||
#define XmNcellPixmapMask "cellPixmapMask"
|
||||
#define XmCCellPixmapMask "CellPixmapMask"
|
||||
#define XmNcellRightBorderType "cellRightBorderType"
|
||||
#define XmCCellRightBorderType "CellRightBorderType"
|
||||
#define XmNcellRightBorderColor "cellRightBorderColor"
|
||||
#define XmCCellRightBorderColor "CellRightBorderColor"
|
||||
#define XmNcellRowSpan "cellRowSpan"
|
||||
#define XmCCellRowSpan "CellRowSpan"
|
||||
#define XmNcellString "cellString"
|
||||
#define XmNcellToggleSet "cellToggleSet"
|
||||
#define XmCCellToggleSet "CellToggleSet"
|
||||
#define XmNcellTopBorderType "cellTopBorderType"
|
||||
#define XmCCellTopBorderType "CellTopBorderType"
|
||||
#define XmNcellTopBorderColor "cellTopBorderColor"
|
||||
#define XmCCellTopBorderColor "CellTopBorderColor"
|
||||
#define XmNcellType "cellType"
|
||||
#define XmCCellType "CellType"
|
||||
#define XmRCellType "CellType"
|
||||
#define XmNcellUserData "cellUserData"
|
||||
|
||||
/* Grid callbacks */
|
||||
|
||||
typedef struct _XmLGridDrawStruct
|
||||
{
|
||||
GC gc;
|
||||
XRectangle *cellRect;
|
||||
Dimension topMargin;
|
||||
Dimension bottomMargin;
|
||||
Dimension leftMargin;
|
||||
Dimension rightMargin;
|
||||
Pixel foreground;
|
||||
Pixel background;
|
||||
Pixel selectForeground;
|
||||
Pixel selectBackground;
|
||||
XmFontList fontList;
|
||||
unsigned char alignment;
|
||||
Boolean drawSelected;
|
||||
int drawFocusType;
|
||||
XmStringDirection stringDirection;
|
||||
} XmLGridDrawStruct;
|
||||
|
||||
typedef struct _XmLGridCallbackStruct
|
||||
{
|
||||
int reason;
|
||||
XEvent *event;
|
||||
unsigned char rowType, columnType;
|
||||
int row, column;
|
||||
XRectangle *clipRect;
|
||||
XmLGridDrawStruct *drawInfo;
|
||||
void *object;
|
||||
} XmLGridCallbackStruct;
|
||||
|
||||
#define XmCR_ADD_ROW 900
|
||||
#define XmCR_ADD_COLUMN 901
|
||||
#define XmCR_ADD_CELL 902
|
||||
#define XmCR_CELL_DRAW 903
|
||||
#define XmCR_CELL_DROP 904
|
||||
#define XmCR_CELL_FOCUS_IN 905
|
||||
#define XmCR_CELL_FOCUS_OUT 906
|
||||
#define XmCR_CELL_PASTE 907
|
||||
#define XmCR_CONF_TEXT 908
|
||||
#define XmCR_PREF_WIDTH 909
|
||||
#define XmCR_DELETE_ROW 910
|
||||
#define XmCR_DELETE_COLUMN 911
|
||||
#define XmCR_DELETE_CELL 912
|
||||
#define XmCR_EDIT_BEGIN 913
|
||||
#define XmCR_EDIT_INSERT 914
|
||||
#define XmCR_EDIT_CANCEL 915
|
||||
#define XmCR_EDIT_COMPLETE 916
|
||||
#define XmCR_FREE_VALUE 917
|
||||
#define XmCR_RESIZE_ROW 918
|
||||
#define XmCR_RESIZE_COLUMN 919
|
||||
#define XmCR_PREF_HEIGHT 920
|
||||
#define XmCR_SCROLL_ROW 921
|
||||
#define XmCR_SCROLL_COLUMN 922
|
||||
#define XmCR_SELECT_CELL 923
|
||||
#define XmCR_SELECT_COLUMN 924
|
||||
#define XmCR_SELECT_ROW 925
|
||||
#define XmCR_DESELECT_CELL 926
|
||||
#define XmCR_DESELECT_COLUMN 927
|
||||
#define XmCR_DESELECT_ROW 928
|
||||
|
||||
/* xfe added callback reason */
|
||||
#define XmCR_RESIZE_GRID 929
|
||||
#define XmCR_SHOW_POPUP 930
|
||||
#define XmCR_SINGLECLICK 931
|
||||
|
||||
#define XmCR_ENTER_CELL 931
|
||||
#define XmCR_ENTER_GRID 932
|
||||
#define XmCR_LEAVE_CELL 933
|
||||
#define XmCR_LEAVE_GRID 934
|
||||
|
||||
/* Grid defines */
|
||||
|
||||
#define XmCONTENT 0
|
||||
#define XmHEADING 1
|
||||
#define XmFOOTER 2
|
||||
#define XmALL_TYPES 3
|
||||
#define XmINVALID_TYPE 4
|
||||
|
||||
#define XmICON_CELL 0
|
||||
#define XmPIXMAP_CELL 1
|
||||
#define XmSTRING_CELL 2
|
||||
|
||||
#define XmBORDER_NONE 0
|
||||
#define XmBORDER_LINE 1
|
||||
#define XmBORDER_DASH 2
|
||||
|
||||
#define XmFORMAT_DELIMITED 1
|
||||
#define XmFORMAT_XL 2
|
||||
#define XmFORMAT_PAD 3
|
||||
#define XmFORMAT_PASTE 4
|
||||
#define XmFORMAT_DROP 5
|
||||
|
||||
#define XmSELECT_NONE 1
|
||||
#define XmSELECT_SINGLE_ROW 2
|
||||
#define XmSELECT_BROWSE_ROW 3
|
||||
#define XmSELECT_MULTIPLE_ROW 4
|
||||
#define XmSELECT_CELL 5
|
||||
|
||||
#define XmDRAW_FOCUS_NONE 1
|
||||
#define XmDRAW_FOCUS_CELL 2
|
||||
#define XmDRAW_FOCUS_LEFT 3
|
||||
#define XmDRAW_FOCUS_MID 4
|
||||
#define XmDRAW_FOCUS_RIGHT 5
|
||||
|
||||
#define XmTRAVERSE_EXTEND_DOWN 20
|
||||
#define XmTRAVERSE_EXTEND_LEFT 21
|
||||
#define XmTRAVERSE_EXTEND_RIGHT 22
|
||||
#define XmTRAVERSE_EXTEND_UP 23
|
||||
#define XmTRAVERSE_PAGE_DOWN 24
|
||||
#define XmTRAVERSE_PAGE_LEFT 25
|
||||
#define XmTRAVERSE_PAGE_RIGHT 26
|
||||
#define XmTRAVERSE_PAGE_UP 27
|
||||
#define XmTRAVERSE_TO_BOTTOM 28
|
||||
#define XmTRAVERSE_TO_TOP 29
|
||||
|
||||
#define XmALIGNMENT_LEFT 0
|
||||
#ifndef XmALIGNMENT_CENTER
|
||||
#define XmALIGNMENT_CENTER 1
|
||||
#endif
|
||||
#define XmALIGNMENT_RIGHT 2
|
||||
#define XmALIGNMENT_TOP_LEFT 3
|
||||
#define XmALIGNMENT_TOP 4
|
||||
#define XmALIGNMENT_TOP_RIGHT 5
|
||||
#define XmALIGNMENT_BOTTOM_LEFT 6
|
||||
#define XmALIGNMENT_BOTTOM 7
|
||||
#define XmALIGNMENT_BOTTOM_RIGHT 8
|
||||
|
||||
/* xfe additions */
|
||||
#define XmSORT_NONE 0
|
||||
#define XmSORT_ASCENDING 1
|
||||
#define XmSORT_DESCENDING 2
|
||||
|
||||
/* Progress resources */
|
||||
|
||||
#define XmNcompleteValue "completeValue"
|
||||
#define XmCCompleteValue "CompleteValue"
|
||||
#define XmNnumBoxes "numBoxes"
|
||||
#define XmCNumBoxes "NumBoxes"
|
||||
#define XmNmeterStyle "meterStyle"
|
||||
#define XmCMeterStyle "MeterStyle"
|
||||
#define XmRMeterStyle "MeterStyle"
|
||||
#define XmNshowPercentage "showPercentage"
|
||||
#define XmCShowPercentage "ShowPercentage"
|
||||
#define XmNshowTime "showTime"
|
||||
#define XmCShowTime "ShowTime"
|
||||
|
||||
/* Progress defines */
|
||||
|
||||
#define XmMETER_BAR 0
|
||||
#define XmMETER_BOXES 1
|
||||
|
||||
/* Tree resources */
|
||||
|
||||
#define XmNcollapseCallback "collapseCallback"
|
||||
#define XmNconnectingLineColor "connectingLineColor"
|
||||
#define XmCConnectingLineColor "ConnectingLineColor"
|
||||
#define XmNexpandCallback "expandCallback"
|
||||
#define XmNlevelSpacing "levelSpacing"
|
||||
#define XmCLevelSpacing "LevelSpacing"
|
||||
#define XmNplusMinusColor "plusMinusColor"
|
||||
#define XmCPlusMinusColor "PlusMinusColor"
|
||||
#define XmNrowExpands "rowExpands"
|
||||
#define XmCRowExpands "RowExpands"
|
||||
#define XmNrowIsExpanded "rowIsExpanded"
|
||||
#define XmCRowIsExpanded "RowIsExpanded"
|
||||
#define XmNrowLevel "rowLevel"
|
||||
#define XmCRowLevel "RowLevel"
|
||||
#define XmNignorePixmaps "ignorePixmaps"
|
||||
#define XmCIgnorePixmaps "IgnorePixmaps"
|
||||
|
||||
/* Tree callbacks */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int level;
|
||||
Boolean expands;
|
||||
Boolean isExpanded;
|
||||
Pixmap pixmap, pixmask;
|
||||
XmString string;
|
||||
} XmLTreeRowDefinition;
|
||||
|
||||
#define XmCR_COLLAPSE_ROW 950
|
||||
#define XmCR_EXPAND_ROW 951
|
||||
|
||||
/* Backwards compatibility */
|
||||
|
||||
#ifdef XmLBACKWARDS_COMPATIBILITY
|
||||
|
||||
#define XmNfooterColumnCount "footerColumns"
|
||||
#define XmNfooterRowCount "footerRows"
|
||||
#define XmNheadingColumnCount "headingColumns"
|
||||
#define XmNheadingRowCount "headingRows"
|
||||
#define XmNcellBottomBorderPixel "cellBottomBorderColor"
|
||||
#define XmCCellBottomBorderPixel "CellBottomBorderColor"
|
||||
#define XmNcellLeftBorderPixel "cellLeftBorderColor"
|
||||
#define XmCCellLeftBorderPixel "CellLeftBorderColor"
|
||||
#define XmNcellRightBorderPixel "cellRightBorderColor"
|
||||
#define XmCCellRightBorderPixel "CellRightBorderColor"
|
||||
#define XmNcellTopBorderPixel "cellTopBorderColor"
|
||||
#define XmCCellTopBorderPixel "CellTopBorderColor"
|
||||
|
||||
#define XmTEXT_CELL 250
|
||||
#define XmLABEL_CELL 251
|
||||
|
||||
typedef void XmLCGridRow;
|
||||
typedef void XmLCGridColumn;
|
||||
typedef void XmLCGridCell;
|
||||
|
||||
#endif
|
||||
|
||||
/* Utility defines */
|
||||
|
||||
#define XmDRAWNB_ARROW 0
|
||||
#define XmDRAWNB_ARROWLINE 1
|
||||
#define XmDRAWNB_DOUBLEARROW 2
|
||||
#define XmDRAWNB_SQUARE 3
|
||||
#define XmDRAWNB_DOUBLEBAR 4
|
||||
#define XmDRAWNB_STRING 5
|
||||
#define XmDRAWNB_SMALLARROW 6
|
||||
|
||||
#define XmDRAWNB_RIGHT 0
|
||||
#define XmDRAWNB_LEFT 1
|
||||
#define XmDRAWNB_UP 2
|
||||
#define XmDRAWNB_DOWN 3
|
||||
|
||||
#define XmSTRING_RIGHT 0
|
||||
#define XmSTRING_LEFT 1
|
||||
#define XmSTRING_UP 2
|
||||
#define XmSTRING_DOWN 3
|
||||
|
||||
enum { XmLRectInside, XmLRectOutside, XmLRectPartial };
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int pos;
|
||||
} XmLArrayItem;
|
||||
|
||||
typedef struct _XmLArrayRec *XmLArray;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
unsigned char value;
|
||||
} XmLStringToUCharMap;
|
||||
|
||||
/* Utility functions */
|
||||
|
||||
typedef int (*XmLSortCompareFunc)(void *userData, void *l, void *r);
|
||||
typedef int (*XmLArrayCompareFunc)(void *, void **, void **);
|
||||
|
||||
XmLArray XmLArrayNew(char autonumber, char growFast);
|
||||
void XmLArrayFree(XmLArray array);
|
||||
void XmLArrayAdd(XmLArray array, int pos, int count);
|
||||
int XmLArrayDel(XmLArray array, int pos, int count);
|
||||
int XmLArraySet(XmLArray array, int pos, void *item);
|
||||
void *XmLArrayGet(XmLArray array, int pos);
|
||||
int XmLArrayGetCount(XmLArray array);
|
||||
int XmLArrayMove(XmLArray array, int newPos, int pos, int count);
|
||||
int XmLArrayReorder(XmLArray array, int *newPositions,
|
||||
int pos, int count);
|
||||
int XmLArraySort(XmLArray array, XmLArrayCompareFunc compare,
|
||||
void *userData, int pos, int count);
|
||||
Boolean XmLCvtStringToUChar(Display *dpy, char *resname,
|
||||
XmLStringToUCharMap *map, XrmValuePtr fromVal, XrmValuePtr toVal);
|
||||
int XmLDateDaysInMonth(int m, int y);
|
||||
int XmLDateWeekDay(int m, int d, int y);
|
||||
void XmLDrawnButtonSetType(Widget w, int drawnType, int drawnDir);
|
||||
void XmLDrawToggle(Widget w, Boolean state, Dimension size,
|
||||
unsigned char alignment, GC gc, Pixel backgroundColor,
|
||||
Pixel topColor, Pixel bottomColor, Pixel checkColor,
|
||||
XRectangle *rect, XRectangle *clipRect);
|
||||
XmFontList XmLFontListCopyDefault(Widget widget);
|
||||
void XmLFontListGetDimensions(XmFontList fontList, short *width,
|
||||
short *height, Boolean useAverageWidth);
|
||||
void XmLInitialize(void);
|
||||
int XmLMessageBox(Widget w, char *string, Boolean okOnly);
|
||||
void XmLPixmapDraw(Widget w, Pixmap pixmap, Pixmap pixmask,
|
||||
int pixmapWidth, int pixmapHeight, unsigned char alignment,
|
||||
GC gc, XRectangle *rect, XRectangle *clipRect);
|
||||
int XmLRectIntersect(XRectangle *r1, XRectangle *r2);
|
||||
Widget XmLShellOfWidget(Widget w);
|
||||
void XmLSort(void *base, int numItems, unsigned int itemSize,
|
||||
XmLSortCompareFunc, void *userData);
|
||||
void XmLStringDraw(Widget w, XmString string, XmStringDirection stringDir,
|
||||
XmFontList fontList, unsigned char alignment, GC gc,
|
||||
XRectangle *rect, XRectangle *clipRect);
|
||||
void XmLStringDrawDirection(Display *dpy, Window win, XmFontList fontlist,
|
||||
XmString string, GC gc, int x, int y, Dimension width,
|
||||
unsigned char alignment, unsigned char layout_direction,
|
||||
unsigned char drawing_direction);
|
||||
void XmLWarning(Widget w, char *msg);
|
||||
|
||||
#ifdef XmL_CPP
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,162 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
! Common Resources
|
||||
|
||||
value
|
||||
XmNblankBackground : argument ('blankBackground', color);
|
||||
XmNautoSelect : argument ('autoSelect', boolean);
|
||||
XmNdebugLevel : argument ('debugLevel', integer);
|
||||
|
||||
! Folder Widget
|
||||
|
||||
procedure
|
||||
XmLCreateFolder();
|
||||
|
||||
! Folder Resources
|
||||
|
||||
value
|
||||
XmNcornerDimension : argument ('cornerDimension', integer);
|
||||
XmNcornerStyle : argument ('cornerStyle', integer);
|
||||
CornerNone : 0;
|
||||
CornerLine : 1;
|
||||
CornerArc : 2;
|
||||
XmNinactiveBackground : argument ('inactiveBackground', color);
|
||||
XmNinactiveForeground : argument ('inactiveForeground', color);
|
||||
XmNpixmapMargin : argument ('pixmapMargin', integer);
|
||||
ResizeStatic : 10;
|
||||
ResizeDynamic : 11;
|
||||
XmNrotateWhenLeftRight : argument ('rotateWhenRightLeft', boolean);
|
||||
XmNtabPlacement : argument ('tabPlacement', integer);
|
||||
FolderTop : 0;
|
||||
FolderLeft : 1;
|
||||
FolderBottom : 2;
|
||||
FolderRight : 3;
|
||||
XmNtabsPerRow : argument ('tabsPerRow', integer);
|
||||
|
||||
! Folder Constraint resources
|
||||
|
||||
XmNtabFreePixmaps : argument ('tabFreePixmaps', boolean);
|
||||
XmNtabManagedName : argument ('tabManagedName', string);
|
||||
XmNtabManagedWidget : argument ('tabManagedWidget', any);
|
||||
|
||||
! Grid Widget
|
||||
|
||||
procedure
|
||||
XmLCreateGrid();
|
||||
|
||||
! Grid Resources
|
||||
|
||||
value
|
||||
XmNallowColumnHide : argument ('allowColumnHide', boolean);
|
||||
XmNallowColumnResize : argument ('allowColumnResize', boolean);
|
||||
XmNallowDragSelected : argument ('allowDragSelected', boolean);
|
||||
XmNallowDrop : argument ('allowDrop', boolean);
|
||||
XmNallowRowHide : argument ('allowRowHide', boolean);
|
||||
XmNallowRowResize : argument ('allowRowResize', boolean);
|
||||
XmNbottomFixedCount : argument ('bottomFixedCount', integer);
|
||||
XmNbottomFixedMargin : argument ('bottomFixedMargin', integer);
|
||||
XmNfooterColumns : argument ('footerColumns', integer);
|
||||
XmNfooterRows : argument ('footerRows', integer);
|
||||
XmNglobalPixmapHeight : argument ('globalPixmapHeight', integer);
|
||||
XmNglobalPixmapWidth : argument ('globalPixmapWidth', integer);
|
||||
XmNheadingColumns : argument ('headingColumns', integer);
|
||||
XmNheadingRows : argument ('headingRows', integer);
|
||||
XmNhighlightRowMode : argument ('highlightRowMode', boolean);
|
||||
XmNhorizontalSizePolicy : argument ('horizontalSizePolicy', integer);
|
||||
XmNhsbDisplayPolicy : argument ('hsbDisplayPolicy', integer);
|
||||
XmNimmediateDraw : argument ('immediateDraw', boolean);
|
||||
XmNleftFixedCount : argument ('leftFixedCount', integer);
|
||||
XmNleftFixedMargin : argument ('leftFixedMargin', integer);
|
||||
XmNrightFixedCount : argument ('rightFixedCount', integer);
|
||||
XmNrightFixedMargin : argument ('rightFixedMargin', integer);
|
||||
XmNscrollBarMargin : argument ('scrollBarMargin', integer);
|
||||
SelectNone : 1;
|
||||
SelectSingleRow : 2;
|
||||
SelectBrowseRow : 3;
|
||||
SelectMultipleRow : 4;
|
||||
SelectCell : 5;
|
||||
XmNselectBackground : argument ('selectBackground', color);
|
||||
XmNselectForeground : argument ('selectForeground', color);
|
||||
XmNshadowRegions : argument ('shadowRegions', integer);
|
||||
XmNsimpleHeadings : argument ('simpleHeadings', string);
|
||||
XmNsimpleWidths : argument ('simpleWidths', string);
|
||||
XmNtopFixedCount : argument ('topFixedCount', integer);
|
||||
XmNtopFixedMargin : argument ('topFixedMargin', integer);
|
||||
XmNuseAverageFontWidth : argument ('useAverageFontWidth', boolean);
|
||||
XmNverticalSizePolicy : argument ('verticalSizePolicy', integer);
|
||||
XmNvisibleColumns : argument ('visibleColumns', integer);
|
||||
XmNvisibleRows : argument ('visibleRows', integer);
|
||||
XmNvsbDisplayPolicy : argument ('vsbDisplayPolicy', integer);
|
||||
|
||||
! Grid Callbacks
|
||||
|
||||
value
|
||||
XmNaddCallback : reason ('addCallback');
|
||||
XmNcellDrawCallback : reason ('cellDrawCallback');
|
||||
XmNcellDropCallback : reason ('cellDropCallback');
|
||||
XmNcellFocusCallback : reason ('cellFocusCallback');
|
||||
XmNcellPasteCallback : reason ('cellPasteCallback');
|
||||
XmNdeleteCallback : reason ('deleteCallback');
|
||||
XmNdeselectCallback : reason ('deselectCallback');
|
||||
XmNeditCallback : reason ('editCallback');
|
||||
XmNscrollCallback : reason ('scrollCallback');
|
||||
XmNselectCallback : reason ('selectCallback');
|
||||
|
||||
! Progress Widget
|
||||
|
||||
procedure
|
||||
XmLCreateProgress();
|
||||
|
||||
! Progress Resources
|
||||
|
||||
value
|
||||
XmNcompleteValue : argument ('completeValue', integer);
|
||||
XmNmeterStyle : argument ('meterStyle', integer);
|
||||
MeterBar : 0;
|
||||
MeterBoxes : 1;
|
||||
XmNnumBoxes : argument ('numBoxes', integer);
|
||||
XmNshowTime : argument ('showTime', boolean);
|
||||
XmNshowPercentage : argument ('showPercentage', boolean);
|
||||
|
||||
! Tree Widget
|
||||
|
||||
procedure
|
||||
XmLCreateTree();
|
||||
|
||||
! Tree Resources
|
||||
|
||||
value
|
||||
XmNconnectingLineColor : argument ('connectingLineColor', color);
|
||||
XmNlevelSpacing : argument ('levelSpacing', integer);
|
||||
XmNplusMinusColor : argument ('plusMinusColor', color);
|
||||
|
||||
! Tree Callbacks
|
||||
|
||||
value
|
||||
XmNexpandCallback : reason ('expandCallback');
|
||||
XmNcollapseCallback : reason ('collapseCallback');
|
||||
@@ -1,168 +0,0 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# This make file was copied from ns/cmd/xfe/XfeWidgets/tests/Makefile
|
||||
# and tweaked. A lot of the rules and logic can probably be shared.
|
||||
# Stuff should be shared in
|
||||
#
|
||||
#
|
||||
DEPTH = ../../../..
|
||||
|
||||
ifdef XFE_WIDGETS_BUILD_UNUSED
|
||||
UNUSED_CSRCS = \
|
||||
demo.c \
|
||||
prog1.c \
|
||||
prog2.c \
|
||||
prog3.c \
|
||||
uil1.c \
|
||||
util1.c \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
CSRCS = \
|
||||
$(UNUSED_CSRCS) \
|
||||
folder1.c \
|
||||
folder2.c \
|
||||
folder3.c \
|
||||
folder4.c \
|
||||
grid1.c \
|
||||
grid2.c \
|
||||
grid3.c \
|
||||
grid4.c \
|
||||
grid5.c \
|
||||
grid6.c \
|
||||
tree1.c \
|
||||
tree2.c \
|
||||
tree3.c \
|
||||
tree4.c \
|
||||
tree5.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = \
|
||||
Microline
|
||||
|
||||
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.exe))
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
include $(DEPTH)/cmd/xfe/XfeWidgets/XfeWidgets.mk
|
||||
|
||||
all:: $(PROGS)
|
||||
install:: $(PROGS)
|
||||
|
||||
LDFLAGS =
|
||||
|
||||
SHARED_XFE_LIBS = $(DIST)/bin/libXmL.$(DLL_SUFFIX)
|
||||
|
||||
STATIC_XFE_LIBS = $(DIST)/lib/libXmL.a
|
||||
|
||||
DIST_FLAGS = -L$(DIST)/bin
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
|
||||
XFE_FLAGS = $(STATIC_XFE_LIBS)
|
||||
|
||||
else
|
||||
|
||||
XFE_FLAGS = $(SHARED_XFE_LIBS)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
-include $(DEPTH)/config/motif.mk
|
||||
endif
|
||||
|
||||
XM_LD_FLAGS = -lMrm -lXm $(NS_MOTIF2_XP_LD_FLAGS)
|
||||
|
||||
X_LD_FLAGS = $(XM_LD_FLAGS) -lXt -lXmu -lXext -lX11
|
||||
|
||||
OS_BEFORE_FLAGS =
|
||||
OS_AFTER_FLAGS =
|
||||
|
||||
ifeq ($(OS_ARCH),SunOS)
|
||||
|
||||
OS_BEFORE_LDFLAGS =\
|
||||
-L/usr/dt/lib \
|
||||
-L/usr/openwin/lib
|
||||
|
||||
OS_AFTER_LDFLAGS =\
|
||||
-lw \
|
||||
-lintl \
|
||||
-lsocket \
|
||||
-lnsl \
|
||||
-lgen \
|
||||
-lm \
|
||||
-ldl
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
|
||||
OS_BEFORE_LDFLAGS =\
|
||||
-L/usr/dt/lib
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),IRIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
|
||||
OS_BEFORE_LDFLAGS = -L/usr/X11R6/lib
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),HP-UX)
|
||||
|
||||
OS_BEFORE_LDFLAGS = -L$(DIST)/bin
|
||||
|
||||
endif
|
||||
|
||||
LDFLAGS =\
|
||||
$(OS_BEFORE_LDFLAGS) \
|
||||
$(DIST_FLAGS) \
|
||||
$(XFE_FLAGS) \
|
||||
$(X_LD_FLAGS) \
|
||||
$(OS_AFTER_LDFLAGS)
|
||||
|
||||
##
|
||||
## Test dependancies
|
||||
##
|
||||
#OTHER_DEPS = Makefile $(XFE_FLAGS)
|
||||
OTHER_DEPS = $(XFE_FLAGS)
|
||||
|
||||
##
|
||||
## Resource source rule
|
||||
##
|
||||
#$(OBJDIR)/%.ad.c:: %.ad # Makefile
|
||||
# @$(MAKE_OBJDIR)
|
||||
# @echo 'char * fallback_resources[] = {' > $@; \
|
||||
# ./ad2c $< >> $@; \
|
||||
# echo '0};' >> $@
|
||||
|
||||
##
|
||||
## Resource object rule
|
||||
##
|
||||
#$(OBJDIR)/%.ad.o: $(OBJDIR)/%.ad.c
|
||||
# @$(MAKE_OBJDIR)
|
||||
# $(CC) -o $@ -c $<
|
||||
|
||||
##
|
||||
## Binary link rule
|
||||
##
|
||||
$(OBJDIR)/%.exe: $(OBJDIR)/%.o $(OTHER_DEPS)
|
||||
@$(MAKE_OBJDIR)
|
||||
$(XFE_PURIFY) $(CC) -o $@ $< $(LDFLAGS)
|
||||
@@ -1,173 +0,0 @@
|
||||
#! gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
#
|
||||
# This make file was copied from ns/cmd/xfe/XfeWidgets/tests/Makefile
|
||||
# and tweaked. A lot of the rules and logic can probably be shared.
|
||||
# Stuff should be shared in
|
||||
#
|
||||
#
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef XFE_WIDGETS_BUILD_UNUSED
|
||||
UNUSED_CSRCS = \
|
||||
demo.c \
|
||||
prog1.c \
|
||||
prog2.c \
|
||||
prog3.c \
|
||||
uil1.c \
|
||||
util1.c \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
CSRCS = \
|
||||
$(UNUSED_CSRCS) \
|
||||
folder1.c \
|
||||
folder2.c \
|
||||
folder3.c \
|
||||
folder4.c \
|
||||
grid1.c \
|
||||
grid2.c \
|
||||
grid3.c \
|
||||
grid4.c \
|
||||
grid5.c \
|
||||
grid6.c \
|
||||
tree1.c \
|
||||
tree2.c \
|
||||
tree3.c \
|
||||
tree4.c \
|
||||
tree5.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = \
|
||||
Microline
|
||||
|
||||
PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=.exe))
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
include $(topsrcdir)/cmd/xfe/XfeWidgets/XfeWidgets.mk
|
||||
|
||||
all:: $(PROGS)
|
||||
install:: $(PROGS)
|
||||
|
||||
LDFLAGS =
|
||||
|
||||
SHARED_XFE_LIBS = $(DIST)/bin/libXmL.$(DLL_SUFFIX)
|
||||
|
||||
STATIC_XFE_LIBS = $(DIST)/lib/libXmL.a
|
||||
|
||||
DIST_FLAGS = -L$(DIST)/bin
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
|
||||
XFE_FLAGS = $(STATIC_XFE_LIBS)
|
||||
|
||||
else
|
||||
|
||||
XFE_FLAGS = $(SHARED_XFE_LIBS)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
-include $(DEPTH)/config/motif.mk
|
||||
endif
|
||||
|
||||
XM_LD_FLAGS = -lMrm -lXm $(NS_MOTIF2_XP_LD_FLAGS)
|
||||
|
||||
X_LD_FLAGS = $(XM_LD_FLAGS) -lXt -lXmu -lXext -lX11
|
||||
|
||||
OS_BEFORE_FLAGS =
|
||||
OS_AFTER_FLAGS =
|
||||
|
||||
ifeq ($(OS_ARCH),SunOS)
|
||||
|
||||
OS_BEFORE_LDFLAGS =\
|
||||
-L/usr/dt/lib \
|
||||
-L/usr/openwin/lib
|
||||
|
||||
OS_AFTER_LDFLAGS =\
|
||||
-lw \
|
||||
-lintl \
|
||||
-lsocket \
|
||||
-lnsl \
|
||||
-lgen \
|
||||
-lm \
|
||||
-ldl
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
|
||||
OS_BEFORE_LDFLAGS =\
|
||||
-L/usr/dt/lib
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),IRIX)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
|
||||
OS_BEFORE_LDFLAGS = -L/usr/X11R6/lib
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),HP-UX)
|
||||
|
||||
OS_BEFORE_LDFLAGS = -L$(DIST)/bin
|
||||
|
||||
endif
|
||||
|
||||
LDFLAGS =\
|
||||
$(OS_BEFORE_LDFLAGS) \
|
||||
$(DIST_FLAGS) \
|
||||
$(XFE_FLAGS) \
|
||||
$(X_LD_FLAGS) \
|
||||
$(OS_AFTER_LDFLAGS)
|
||||
|
||||
##
|
||||
## Test dependancies
|
||||
##
|
||||
#OTHER_DEPS = Makefile $(XFE_FLAGS)
|
||||
OTHER_DEPS = $(XFE_FLAGS)
|
||||
|
||||
##
|
||||
## Resource source rule
|
||||
##
|
||||
#$(OBJDIR)/%.ad.c:: %.ad # Makefile
|
||||
# @$(MAKE_OBJDIR)
|
||||
# @echo 'char * fallback_resources[] = {' > $@; \
|
||||
# ./ad2c $< >> $@; \
|
||||
# echo '0};' >> $@
|
||||
|
||||
##
|
||||
## Resource object rule
|
||||
##
|
||||
#$(OBJDIR)/%.ad.o: $(OBJDIR)/%.ad.c
|
||||
# @$(MAKE_OBJDIR)
|
||||
# $(CC) -o $@ -c $<
|
||||
|
||||
##
|
||||
## Binary link rule
|
||||
##
|
||||
$(OBJDIR)/%.exe: $(OBJDIR)/%.o $(OTHER_DEPS)
|
||||
@$(MAKE_OBJDIR)
|
||||
$(XFE_PURIFY) $(CC) -o $@ $< $(LDFLAGS)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,72 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <XmL/Folder.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, folder, form;
|
||||
XmString str;
|
||||
char buf[20];
|
||||
int i;
|
||||
|
||||
shell = XtAppInitialize(&app, "Folder1", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
folder = XtVaCreateManagedWidget("folder",
|
||||
xmlFolderWidgetClass, shell,
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
/* Add a tab and Form managed by the tab to the Folder */
|
||||
sprintf(buf, "Tab %d", i);
|
||||
str = XmStringCreateSimple(buf);
|
||||
form = XmLFolderAddTabForm(folder, str);
|
||||
XmStringFree(str);
|
||||
|
||||
/* Add a Label as a child of the Form */
|
||||
sprintf(buf, "Form %d", i);
|
||||
XtVaCreateManagedWidget(buf,
|
||||
xmLabelWidgetClass, form,
|
||||
XmNmarginWidth, 100,
|
||||
XmNmarginHeight, 80,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
}
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/DrawnB.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <XmL/Folder.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, folder, tab, folderForm;
|
||||
XmString str;
|
||||
char pageName[20], tabName[20];
|
||||
int i;
|
||||
|
||||
shell = XtAppInitialize(&app, "Folder2", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNmarginWidth, 8,
|
||||
XmNmarginHeight, 8,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
folder = XtVaCreateManagedWidget("folder",
|
||||
xmlFolderWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNtabPlacement, XmFOLDER_RIGHT,
|
||||
XmNmarginWidth, 10,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
sprintf(pageName, "Page %d", i);
|
||||
|
||||
/* Add a tab (DrawnButton) to the Folder */
|
||||
sprintf(tabName, "Tab %d", i);
|
||||
str = XmStringCreateSimple(tabName);
|
||||
tab = XtVaCreateManagedWidget("tab",
|
||||
xmDrawnButtonWidgetClass, folder,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNlabelString, str,
|
||||
XmNtabManagedName, pageName,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
|
||||
/* Add a Form to the Folder which will appear in the page */
|
||||
/* area. This Form will be managed by the tab created above */
|
||||
/* because it has the same tabManagedName as the tab widget */
|
||||
folderForm = XtVaCreateManagedWidget("folderForm",
|
||||
xmFormWidgetClass, folder,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNtabManagedName, pageName,
|
||||
NULL);
|
||||
|
||||
/* Add a Label as a child of the Form */
|
||||
XtVaCreateManagedWidget(pageName,
|
||||
xmLabelWidgetClass, folderForm,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNmarginWidth, 100,
|
||||
XmNmarginHeight, 80,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
}
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <XmL/Folder.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, folder, shellForm, label, button;
|
||||
XmString str;
|
||||
char buf[20];
|
||||
int i;
|
||||
static char tabName[6][20] =
|
||||
{
|
||||
"Standard",
|
||||
"PTEL Server",
|
||||
"NTEL Server",
|
||||
"Advanced",
|
||||
"Transfer Address",
|
||||
"Multimedia"
|
||||
};
|
||||
|
||||
shell = XtAppInitialize(&app, "Folder3", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNmarginWidth, 10,
|
||||
XmNmarginHeight, 10,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
folder = XtVaCreateManagedWidget("folder",
|
||||
xmlFolderWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNtabsPerRow, 3,
|
||||
XmNmarginWidth, 10,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
/* Add a tab and Form managed by the tab to the Folder */
|
||||
str = XmStringCreateSimple(tabName[i]);
|
||||
shellForm = XmLFolderAddTabForm(folder, str);
|
||||
XmStringFree(str);
|
||||
|
||||
XtVaSetValues(shellForm,
|
||||
XmNmarginWidth, 8,
|
||||
XmNmarginHeight, 8,
|
||||
NULL);
|
||||
|
||||
/* Add a Label as a child of the Form */
|
||||
sprintf(buf, "Label For Page %d", i);
|
||||
label = XtVaCreateManagedWidget(buf,
|
||||
xmLabelWidgetClass, shellForm,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNmarginWidth, 100,
|
||||
XmNmarginHeight, 80,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
/* Add a Button to pages 0 and 1 */
|
||||
if (i < 2)
|
||||
{
|
||||
button = XtVaCreateManagedWidget("Sample Button",
|
||||
xmPushButtonWidgetClass, shellForm,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNmarginWidth, 5,
|
||||
NULL);
|
||||
XtVaSetValues(label,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
XtVaSetValues(label,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
}
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,228 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/DrawnB.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <XmL/Folder.h>
|
||||
|
||||
void addTab();
|
||||
void removeTab();
|
||||
void activate();
|
||||
|
||||
#define sphere_width 16
|
||||
#define sphere_height 16
|
||||
static unsigned char sphere_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0x38, 0x3f,
|
||||
0xb8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf0, 0x1f, 0xe0, 0x0f,
|
||||
0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
#define monitor_width 16
|
||||
#define monitor_height 16
|
||||
static unsigned char monitor_bits[] = {
|
||||
0x00, 0x00, 0xf8, 0x3f, 0xf8, 0x3f, 0x18, 0x30, 0x58, 0x37, 0x18, 0x30,
|
||||
0x58, 0x37, 0x18, 0x30, 0xf8, 0x3f, 0xf8, 0x3f, 0x80, 0x03, 0x80, 0x03,
|
||||
0xf0, 0x1f, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
Widget folder, label;
|
||||
|
||||
Pixmap monitorPixmap, spherePixmap;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, folderForm, addButton, removeButton;
|
||||
Pixel black, grey;
|
||||
|
||||
shell = XtAppInitialize(&app, "Folder4", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
XtVaSetValues(shell,
|
||||
XmNallowShellResize, True,
|
||||
NULL);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNmarginWidth, 8,
|
||||
XmNmarginHeight, 8,
|
||||
XmNhorizontalSpacing, 4,
|
||||
XmNverticalSpacing, 4,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
/* Create Pixmaps with grey background (from form) */
|
||||
black = BlackPixelOfScreen(XtScreen(shell));
|
||||
XtVaGetValues(form,
|
||||
XmNbackground, &grey,
|
||||
NULL);
|
||||
spherePixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
sphere_bits, sphere_width, sphere_height,
|
||||
black, grey,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
monitorPixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
monitor_bits, monitor_width, monitor_height,
|
||||
black, grey,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
|
||||
removeButton = XtVaCreateManagedWidget("Remove Tab",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNmarginWidth, 10,
|
||||
NULL);
|
||||
XtAddCallback(removeButton, XmNactivateCallback, removeTab, NULL);
|
||||
|
||||
addButton = XtVaCreateManagedWidget("Add Tab",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, removeButton,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNmarginWidth, 20,
|
||||
NULL);
|
||||
XtAddCallback(addButton, XmNactivateCallback, addTab, NULL);
|
||||
|
||||
folder = XtVaCreateManagedWidget("folder",
|
||||
xmlFolderWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNtabsPerRow, 4,
|
||||
XmNcornerStyle, XmCORNER_NONE,
|
||||
XmNspacing, 1,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, removeButton,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNresizePolicy, XmRESIZE_DYNAMIC,
|
||||
NULL);
|
||||
XtAddCallback(folder, XmNactivateCallback, activate, NULL);
|
||||
|
||||
/* Add a Form to the Folder, this will appear in the page area */
|
||||
folderForm = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, folder,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
NULL);
|
||||
|
||||
/* Add a Label as a child of the Form */
|
||||
label = XtVaCreateManagedWidget("Page Area",
|
||||
xmLabelWidgetClass, folderForm,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNmarginWidth, 100,
|
||||
XmNmarginHeight, 80,
|
||||
XmNrecomputeSize, False,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
void addTab(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
Widget tabButton, form;
|
||||
int count;
|
||||
char tabName[30];
|
||||
XmString str;
|
||||
Pixmap pixmap;
|
||||
|
||||
XtVaGetValues(folder,
|
||||
XmNtabCount, &count,
|
||||
NULL);
|
||||
|
||||
/* Every other tab will have a sphere pixmap */
|
||||
if (count % 2)
|
||||
pixmap = spherePixmap;
|
||||
else
|
||||
pixmap = monitorPixmap;
|
||||
|
||||
/* Add a tab (DrawnButton) to the Folder */
|
||||
sprintf(tabName, "Tab %d", count);
|
||||
str = XmStringCreateSimple(tabName);
|
||||
tabButton = XtVaCreateManagedWidget("tab",
|
||||
xmDrawnButtonWidgetClass, folder,
|
||||
XmNlabelString, str,
|
||||
XmNmarginWidth, 8,
|
||||
XmNtabPixmap, pixmap,
|
||||
XmNtabInactivePixmap, pixmap,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
void removeTab(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
int count;
|
||||
WidgetList tabs;
|
||||
|
||||
XtVaGetValues(folder,
|
||||
XmNtabCount, &count,
|
||||
XmNtabWidgetList, &tabs,
|
||||
NULL);
|
||||
if (!count)
|
||||
return;
|
||||
XtDestroyWidget(tabs[count - 1]);
|
||||
}
|
||||
|
||||
void activate(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLFolderCallbackStruct *cbs;
|
||||
XmString str;
|
||||
char buf[20];
|
||||
int pos;
|
||||
|
||||
/* Change the Label in the page area to reflect */
|
||||
/* the selected position */
|
||||
cbs = (XmLFolderCallbackStruct *)callData;
|
||||
sprintf(buf, "Page %d", cbs->pos);
|
||||
str = XmStringCreateSimple(buf);
|
||||
XtVaSetValues(label,
|
||||
XmNlabelString, str,
|
||||
NULL);
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
static char *data =
|
||||
"Europe|CD-ROM|$29\n\
|
||||
Yugoslovia|Floppy|$39\n\
|
||||
North America|Tape|$29\n\
|
||||
South America|CD-ROM|$49\n\
|
||||
Japan|Tape|$49\n\
|
||||
Russia|Floppy|$49\n\
|
||||
Poland|CD-ROM|$39\n\
|
||||
Norway|CD-ROM|$29\n\
|
||||
England|Tape|$49\n\
|
||||
Jordan|CD-ROM|$39";
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, grid;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid1", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, shell,
|
||||
XmNrows, 10,
|
||||
XmNvisibleRows, 7,
|
||||
XmNcolumns, 3,
|
||||
XmNsimpleWidths, "20c 8c 8c",
|
||||
XmNhorizontalSizePolicy, XmVARIABLE,
|
||||
NULL);
|
||||
XmLGridSetStrings(grid, data);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
void showSelected();
|
||||
|
||||
static char *data =
|
||||
"Country|Media|Price\n\
|
||||
Europe|CD-ROM|$29\n\
|
||||
Yugoslovia|Floppy|$39\n\
|
||||
North America|Tape|$29\n\
|
||||
South America|CD-ROM|$49\n\
|
||||
Japan|Tape|$49\n\
|
||||
Russia|Floppy|$49\n\
|
||||
Poland|CD-ROM|$39\n\
|
||||
Norway|CD-ROM|$29\n\
|
||||
England|Tape|$49\n\
|
||||
Jordan|CD-ROM|$39";
|
||||
|
||||
Widget grid;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, button;
|
||||
XmString str;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid2", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNmarginWidth, 5,
|
||||
XmNmarginHeight, 5,
|
||||
XmNverticalSpacing, 5,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
str = XmStringCreateSimple("Print Selected");
|
||||
button = XtVaCreateManagedWidget("button",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNlabelString, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
XtAddCallback(button, XmNactivateCallback, showSelected, NULL);
|
||||
|
||||
/* Create a Grid in multiple row select mode with 1 heading row */
|
||||
/* and 3 columns */
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XmNheadingRows, 1,
|
||||
XmNvisibleRows, 7,
|
||||
XmNcolumns, 3,
|
||||
XmNsimpleWidths, "20c 10c 10c",
|
||||
XmNhorizontalSizePolicy, XmVARIABLE,
|
||||
XmNvsbDisplayPolicy, XmSTATIC,
|
||||
XmNhighlightRowMode, True,
|
||||
XmNselectionPolicy, XmSELECT_MULTIPLE_ROW,
|
||||
XmNshadowThickness, 0,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
/* Set default cell values for new cells (which will be the */
|
||||
/* cells created when we add content rows) */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
NULL);
|
||||
/* Set default cell alignment for new cells in columns 0 and 1 */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumnRangeStart, 0,
|
||||
XmNcolumnRangeEnd, 1,
|
||||
XmNcellAlignment, XmALIGNMENT_LEFT,
|
||||
NULL);
|
||||
/* Set default cell alignment for new cells in column 2 */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumn, 2,
|
||||
XmNcellAlignment, XmALIGNMENT_RIGHT,
|
||||
NULL);
|
||||
/* Add 10 content rows */
|
||||
XtVaSetValues(grid,
|
||||
XmNrows, 10,
|
||||
NULL);
|
||||
XmLGridSetStrings(grid, data);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
void showSelected(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
int i, count, *pos;
|
||||
|
||||
printf ("Selected Rows: ");
|
||||
count = XmLGridGetSelectedRowCount(grid);
|
||||
if (count)
|
||||
{
|
||||
pos = (int *)malloc(sizeof(int) * count);
|
||||
XmLGridGetSelectedRows(grid, pos, count);
|
||||
for (i = 0; i < count; i++)
|
||||
printf ("%d ", pos[i]);
|
||||
free((char *)pos);
|
||||
}
|
||||
else
|
||||
printf ("none");
|
||||
printf ("\n");
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
Widget label, text, grid, gridText;
|
||||
|
||||
static int busy = 0;
|
||||
|
||||
void cellFocus();
|
||||
void textModify();
|
||||
void copy();
|
||||
void paste();
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, copyButton, pasteButton;
|
||||
XmString str;
|
||||
char buf[4];
|
||||
int i;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid3", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
str = XmStringCreateSimple("(A 1)");
|
||||
label = XtVaCreateManagedWidget("label",
|
||||
xmLabelWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNmarginHeight, 4,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNlabelString, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
|
||||
pasteButton = XtVaCreateManagedWidget("Paste To Focus",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
XtAddCallback(pasteButton, XmNactivateCallback, paste, NULL);
|
||||
|
||||
copyButton = XtVaCreateManagedWidget("Copy Selected",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, pasteButton,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
XtAddCallback(copyButton, XmNactivateCallback, copy, NULL);
|
||||
|
||||
text = XtVaCreateManagedWidget("text",
|
||||
xmTextWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_WIDGET,
|
||||
XmNleftWidget, label,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, copyButton,
|
||||
XmNmarginHeight, 0,
|
||||
NULL);
|
||||
|
||||
/* Create a Grid with 1 heading column and 1 heading row */
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNheadingColumns, 1,
|
||||
XmNcolumns, 26,
|
||||
XmNvisibleColumns, 8,
|
||||
XmNhsbDisplayPolicy, XmSTATIC,
|
||||
XmNrows, 100,
|
||||
XmNheadingRows, 1,
|
||||
XmNvisibleRows, 12,
|
||||
XmNvsbDisplayPolicy, XmSTATIC,
|
||||
XmNallowDragSelected, True,
|
||||
XmNallowDrop, True,
|
||||
XmNallowRowResize, True,
|
||||
XmNallowColumnResize, True,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, text,
|
||||
XmNtopOffset, 2,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNshadowThickness, 0,
|
||||
XmNselectionPolicy, XmSELECT_CELL,
|
||||
NULL);
|
||||
|
||||
/* Make all cells in the content rows and content columns */
|
||||
/* (the data cells) editable and set their borders and color */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellEditable, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellAlignment, XmALIGNMENT_RIGHT,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XtVaTypedArg, XmNcellRightBorderColor, XmRString, "#606060", 8,
|
||||
XtVaTypedArg, XmNcellBottomBorderColor, XmRString, "#606060", 8,
|
||||
NULL);
|
||||
|
||||
/* Add callbacks which update the Label and to synchronize */
|
||||
/* the Text widget outside the Grid with the one inside the Grid */
|
||||
XtAddCallback(grid, XmNcellFocusCallback, cellFocus, NULL);
|
||||
XtAddCallback(text, XmNvalueChangedCallback, textModify, NULL);
|
||||
XtVaGetValues(grid,
|
||||
XmNtextWidget, &gridText,
|
||||
NULL);
|
||||
XtAddCallback(gridText, XmNvalueChangedCallback, textModify, NULL);
|
||||
|
||||
XtVaSetValues(gridText,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "white", 6,
|
||||
NULL);
|
||||
|
||||
/* Set the labels on the heading rows and columns */
|
||||
for (i = 0; i < 26; i++)
|
||||
{
|
||||
sprintf(buf, "%c", 'A' + i);
|
||||
XmLGridSetStringsPos(grid, XmHEADING, 0, XmCONTENT, i, buf);
|
||||
}
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
sprintf(buf, "%d", i + 1);
|
||||
XmLGridSetStringsPos(grid, XmCONTENT, i, XmHEADING, 0, buf);
|
||||
}
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
|
||||
void cellFocus(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
XmLGridColumn column;
|
||||
Widget sharedText;
|
||||
XmString str;
|
||||
char buf[10], *c;
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
if (cbs->reason != XmCR_CELL_FOCUS_IN)
|
||||
return;
|
||||
|
||||
/* Update the Label to reflect the new focus position */
|
||||
sprintf(buf, "(%c %d)", 'A' + cbs->column, cbs->row + 1);
|
||||
str = XmStringCreateSimple(buf);
|
||||
XtVaSetValues(label,
|
||||
XmNlabelString, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
|
||||
/* Set the Text widget outside the Grid to the string contained */
|
||||
/* in the new focus cell. We set busy here because this change will */
|
||||
/* generate a valueChanged callback and we want to notify our */
|
||||
/* valueChanged callback not to do any processing because of */
|
||||
/* this change */
|
||||
if (busy)
|
||||
return;
|
||||
busy = 1;
|
||||
row = XmLGridGetRow(w, cbs->rowType, cbs->row);
|
||||
column = XmLGridGetColumn(w, cbs->columnType, cbs->column);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcellString, &str,
|
||||
NULL);
|
||||
c = 0;
|
||||
if (str)
|
||||
XmStringGetLtoR(str, XmSTRING_DEFAULT_CHARSET, &c);
|
||||
if (c)
|
||||
{
|
||||
XmTextSetString(text, c);
|
||||
XtFree(c);
|
||||
XmTextSetSelection(text, 0, XmTextGetLastPosition(text),
|
||||
CurrentTime);
|
||||
}
|
||||
else
|
||||
XmTextSetString(text, "");
|
||||
if (str)
|
||||
XmStringFree(str);
|
||||
busy = 0;
|
||||
}
|
||||
|
||||
void textModify(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
int row, column;
|
||||
Boolean focusIn;
|
||||
XmString str;
|
||||
char *c;
|
||||
|
||||
/* If either Text widget changes (the Grid's Text widget or */
|
||||
/* the Text widget outside of the Grid), update the other one */
|
||||
/* to reflect to change and update the Grid itself if the */
|
||||
/* Text widget outside the Grid changes. We set busy in this */
|
||||
/* function to keep the XmTextSetString() from causing this */
|
||||
/* callback to be called while inside the callback. */
|
||||
if (busy)
|
||||
return;
|
||||
busy = 1;
|
||||
c = XmTextGetString(w);
|
||||
if (w == gridText)
|
||||
XmTextSetString(text, c);
|
||||
else
|
||||
{
|
||||
XmLGridGetFocus(grid, &row, &column, &focusIn);
|
||||
if (row != -1 && column != -1)
|
||||
{
|
||||
str = XmStringCreateSimple(c);
|
||||
XtVaSetValues(grid,
|
||||
XmNrow, row,
|
||||
XmNcolumn, column,
|
||||
XmNcellString, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
XmTextSetString(gridText, c);
|
||||
}
|
||||
}
|
||||
XtFree(c);
|
||||
busy = 0;
|
||||
}
|
||||
|
||||
void copy(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCopySelected(grid, CurrentTime);
|
||||
}
|
||||
|
||||
void paste(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
/* This pastes starting at the current focus cell, an alternative */
|
||||
/* method of pasting would be to have the user select an area */
|
||||
/* to paste into. To perform this, we could get the selected area */
|
||||
/* and use XmLGridPastePos() to paste into that area */
|
||||
XmLGridPaste(grid);
|
||||
}
|
||||
@@ -1,285 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
void cellSelect();
|
||||
void showSelected();
|
||||
|
||||
#define HEADINGFONT "-*-helvetica-bold-o-*--*-100-*-*-*-*-iso8859-1"
|
||||
#define CONTENTFONT "-*-helvetica-medium-r-*--*-100-*-*-*-*-iso8859-1"
|
||||
|
||||
#define check_width 9
|
||||
#define check_height 9
|
||||
static unsigned char check_bits[] = {
|
||||
0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x61, 0x00, 0x37, 0x00, 0x3e, 0x00,
|
||||
0x1c, 0x00, 0x08, 0x00, 0x00, 0x00};
|
||||
|
||||
#define nocheck_width 9
|
||||
#define nocheck_height 9
|
||||
static char nocheck_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static char *data[20] =
|
||||
{
|
||||
"3|Bob Thompson|bobt@teledyne.com",
|
||||
"12|Darl Simon|ds@atg.org",
|
||||
"14|Jacq Frontier|jf@terrax.com",
|
||||
"19|Patty Lee|patlee@isis.com",
|
||||
"22|Michal Barnes|mickeyb@softorb.com",
|
||||
"23|Dave Schultz|daves@timing.com",
|
||||
"23|Eric Stanley|ericst@aldor.com",
|
||||
"29|Tim Winters|timw@terra.com",
|
||||
"31|Agin Tomitu|agt@umn.edu",
|
||||
"33|Betty Tinner|bett@ost.edu",
|
||||
"37|Tom Smith|tsmith@netwld.com",
|
||||
"38|Rick Wild|raw@mlsoft.com",
|
||||
"41|Al Joyce|aj@ulm.edu",
|
||||
"41|Tim Burtan|timb@autoc.com",
|
||||
"41|George Marlin|gjm@eyeln.com",
|
||||
"41|Bill Boxer|billb@idesk.com",
|
||||
"41|Maria Montez|marm@ohio.edu",
|
||||
"41|Yin Fang|aj@utxs.edu",
|
||||
"41|Suzy Saps|ss@umg.edu",
|
||||
"41|Jerry Rodgers|jr@lyra.com",
|
||||
};
|
||||
|
||||
Pixmap nocheckPix, checkPix;
|
||||
Widget grid;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, button;
|
||||
Pixel blackPixel, whitePixel;
|
||||
Pixmap pix;
|
||||
int i;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid4", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
/* Create the pixmaps used for checkmarks */
|
||||
blackPixel = BlackPixelOfScreen(XtScreen(shell));
|
||||
whitePixel = WhitePixelOfScreen(XtScreen(shell));
|
||||
checkPix = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
check_bits, check_width, check_height,
|
||||
blackPixel, whitePixel,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
nocheckPix = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
nocheck_bits, nocheck_width, nocheck_height,
|
||||
blackPixel, whitePixel,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
button = XtVaCreateManagedWidget("Show Selected",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XtAddCallback(button, XmNactivateCallback, showSelected, NULL);
|
||||
|
||||
/* Create a Grid with 4 columns. We set the fontList in this */
|
||||
/* function for the Grid to use when calculating the visible rows */
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNfontList, XmRString, CONTENTFONT,
|
||||
strlen(CONTENTFONT) + 1,
|
||||
XmNcolumns, 4,
|
||||
XmNsimpleWidths, "3c 4c 17c 20c",
|
||||
XmNhorizontalSizePolicy, XmVARIABLE,
|
||||
XmNvsbDisplayPolicy, XmSTATIC,
|
||||
XmNvisibleRows, 13,
|
||||
XmNselectionPolicy, XmSELECT_NONE,
|
||||
XmNhighlightRowMode, True,
|
||||
XmNshadowType, XmSHADOW_ETCHED_IN,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_WIDGET,
|
||||
XmNbottomWidget, button,
|
||||
NULL);
|
||||
XtAddCallback(grid, XmNselectCallback, cellSelect, NULL);
|
||||
|
||||
/* Freeze the Grid's layout since we will be making changes which */
|
||||
/* would cause the Grid to recompute its layout. The Grid will */
|
||||
/* recompute its layout when layoutFrozen is set back to False */
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
|
||||
/* Set defaults for new cells and aligments for new cells in */
|
||||
/* columns 1-3. Then, add a heading row */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, HEADINGFONT,
|
||||
strlen(HEADINGFONT) + 1,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "white", 6,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumn, 1,
|
||||
XmNcellAlignment, XmALIGNMENT_RIGHT,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumnRangeStart, 2,
|
||||
XmNcolumnRangeEnd, 3,
|
||||
XmNcellAlignment, XmALIGNMENT_LEFT,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmHEADING, -1, 1);
|
||||
|
||||
/* Set the headings */
|
||||
XmLGridSetStrings(grid, "OD|Qty|Name|EMail Addr");
|
||||
|
||||
/* Set defaults for new cells. Also, set the default cell type */
|
||||
/* for cells in column 0 to pixmap cell. Then add the content rows */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, CONTENTFONT,
|
||||
strlen(CONTENTFONT) + 1,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "black", 6,
|
||||
XmNcellBottomBorderType, XmBORDER_LINE,
|
||||
XtVaTypedArg, XmNcellBottomBorderColor, XmRString, "black", 6,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumn, 0,
|
||||
XmNcellType, XmPIXMAP_CELL,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmCONTENT, -1, 20);
|
||||
|
||||
/* Set the content rows, Rows 2, 4, 5, 8 and 13 will have checkmarks */
|
||||
for (i = 0; i < 20; i++)
|
||||
{
|
||||
XmLGridSetStringsPos(grid, XmCONTENT, i, XmCONTENT, 1, data[i]);
|
||||
if (i == 2 || i == 4 || i == 5 || i == 8 || i == 13)
|
||||
pix = checkPix;
|
||||
else
|
||||
pix = nocheckPix;
|
||||
XtVaSetValues(grid,
|
||||
XmNcolumn, 0,
|
||||
XmNrow, i,
|
||||
XmNcellPixmap, pix,
|
||||
NULL);
|
||||
}
|
||||
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
void showSelected(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridRow row;
|
||||
XmLGridColumn column;
|
||||
Pixmap pix;
|
||||
int i, n;
|
||||
|
||||
/* Display the selected rows, these are the rows which have a */
|
||||
/* checkPix Pixmap in the first cell in the row */
|
||||
printf ("Selected Rows: ");
|
||||
XtVaGetValues(grid,
|
||||
XmNrows, &n,
|
||||
NULL);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
row = XmLGridGetRow(grid, XmCONTENT, i);
|
||||
column = XmLGridGetColumn(grid, XmCONTENT, 0);
|
||||
XtVaGetValues(grid,
|
||||
XmNrowPtr, row,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcellPixmap, &pix,
|
||||
NULL);
|
||||
if (pix == checkPix)
|
||||
printf ("%d ", i);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
void cellSelect(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
XmLGridColumn column;
|
||||
Pixmap pix;
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
if (cbs->reason != XmCR_SELECT_CELL)
|
||||
return;
|
||||
if (cbs->rowType != XmCONTENT)
|
||||
return;
|
||||
|
||||
/* Toggle the Pixmap in the first cell */
|
||||
row = XmLGridGetRow(w, cbs->rowType, cbs->row);
|
||||
column = XmLGridGetColumn(w, XmCONTENT, 0);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcellPixmap, &pix,
|
||||
NULL);
|
||||
if (pix == nocheckPix)
|
||||
pix = checkPix;
|
||||
else
|
||||
pix = nocheckPix;
|
||||
XtVaSetValues(w,
|
||||
XmNrow, cbs->row,
|
||||
XmNcolumn, 0,
|
||||
XmNcellPixmap, pix,
|
||||
NULL);
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
#define TITLEFONT "-*-helvetica-bold-r-*--*-140-*-*-*-*-iso8859-1"
|
||||
#define BOLDFONT "-*-helvetica-bold-r-*--*-120-*-*-*-*-iso8859-1"
|
||||
#define TEXTFONT "-*-helvetica-medium-r-*--*-100-*-*-*-*-iso8859-1"
|
||||
|
||||
static char *data =
|
||||
"|1996 Income Summary\n\
|
||||
|Shampoo|Conditioner|Soap|Total\n\
|
||||
Revenues:\n\
|
||||
Sales|$ 1,600,000|$ 1,000,000|$ 800,000|$ 3,400,000\n\
|
||||
Less Discounts|(16,000)|(10,000)|(8,000)|(34,000)\n\
|
||||
Less Return Allowance|(8,000)|(5,000)|(4,000)|(17,000)\n\
|
||||
Net Revenue|1,576,000|985,000|792,000|3,349,000\n\
|
||||
\n\
|
||||
Less Expenses:\n\
|
||||
Cost of Goods Sold|(640,000)|(330,000)|(264,000)|(1,234,000)\n\
|
||||
Salary Expense|(380,000)|(280,000)|(180,000)|(840,000)\n\
|
||||
Marketing Expense|(157,600)|(98,500)|(79,200)|(335,300)\n\
|
||||
Rent Expense|(36,000)|(36,000)|(36,000)|(108,000)\n\
|
||||
Misc. Other Expense|(36,408)|(22,335)|(16,776)|(75,519)\n\
|
||||
Total Expenses|(1,250,008)|(766,835)|(575,976)|(2,592,819)\n\
|
||||
\n\
|
||||
Income Tax Expense|(130,397)|(87,266)|(86,410)|(304,072)\n\
|
||||
Net Income|195,595|130,899|129,614|456,109";
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, grid;
|
||||
int i, r;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid5", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XmNheadingColumns, 1,
|
||||
XmNcolumns, 3,
|
||||
XmNfooterColumns, 1,
|
||||
XmNsimpleWidths, "24c 11c 11c 11c 11c",
|
||||
XmNvisibleColumns, 10,
|
||||
XmNvisibleRows, 14,
|
||||
XtVaTypedArg, XmNfontList, XmRString, TEXTFONT,
|
||||
strlen(TEXTFONT) + 1,
|
||||
XmNselectionPolicy, XmSELECT_NONE,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
|
||||
/* Add 'Income Summary' heading row with yellow background */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#FFFF00", 8,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "#000080", 8,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XtVaTypedArg, XmNcellBottomBorderColor, XmRString, "black", 6,
|
||||
XmNcellAlignment, XmALIGNMENT_CENTER,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmHEADING, -1, 1);
|
||||
|
||||
/* Set span on '1996 Income Summary' cell in heading row */
|
||||
XtVaSetValues(grid,
|
||||
XmNrowType, XmHEADING,
|
||||
XmNrow, 0,
|
||||
XmNcolumn, 0,
|
||||
XmNcellColumnSpan, 2,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, TITLEFONT,
|
||||
strlen(TITLEFONT) + 1,
|
||||
NULL);
|
||||
|
||||
/* Add 'Shampoo Conditioner Soap' heading row with white background */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, BOLDFONT,
|
||||
strlen(BOLDFONT) + 1,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "black", 6,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmHEADING, -1, 1);
|
||||
|
||||
/* Add content and footer rows with heading column 0 left justified */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcellAlignment, XmALIGNMENT_RIGHT,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, TEXTFONT,
|
||||
strlen(TEXTFONT) + 1,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumnType, XmHEADING,
|
||||
XmNcolumn, 0,
|
||||
XmNcellAlignment, XmALIGNMENT_LEFT,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmCONTENT, -1, 15);
|
||||
|
||||
/* Add footer row with blue background */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, BOLDFONT,
|
||||
strlen(BOLDFONT) + 1,
|
||||
NULL);
|
||||
XmLGridAddRows(grid, XmFOOTER, -1, 1);
|
||||
|
||||
/* Bold 'Revenues' cell */
|
||||
XtVaSetValues(grid,
|
||||
XmNcolumnType, XmHEADING,
|
||||
XmNcolumn, 0,
|
||||
XmNrow, 0,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, BOLDFONT,
|
||||
strlen(BOLDFONT) + 1,
|
||||
NULL);
|
||||
|
||||
/* Bold 'Less Expenses' cell */
|
||||
XtVaSetValues(grid,
|
||||
XmNcolumnType, XmHEADING,
|
||||
XmNcolumn, 0,
|
||||
XmNrow, 6,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, BOLDFONT,
|
||||
strlen(BOLDFONT) + 1,
|
||||
NULL);
|
||||
|
||||
/* Grey middle and footer content column */
|
||||
XtVaSetValues(grid,
|
||||
XmNcolumnType, XmALL_TYPES,
|
||||
XmNcolumnRangeStart, 2,
|
||||
XmNcolumnRangeEnd, 4,
|
||||
XmNcolumnStep, 2,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#E8E8E8", 8,
|
||||
NULL);
|
||||
|
||||
/* Grey 'Conditioner' and 'Total' cell in heading row 1 */
|
||||
XtVaSetValues(grid,
|
||||
XmNrowType, XmHEADING,
|
||||
XmNrow, 1,
|
||||
XmNcolumnType, XmALL_TYPES,
|
||||
XmNcolumnRangeStart, 2,
|
||||
XmNcolumnRangeEnd, 4,
|
||||
XmNcolumnStep, 2,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#E8E8E8", 8,
|
||||
NULL);
|
||||
|
||||
/* Blue and bold 'Net Revenue' and 'Total Expenses' rows */
|
||||
XtVaSetValues(grid,
|
||||
XmNrowRangeStart, 4,
|
||||
XmNrowRangeEnd, 12,
|
||||
XmNrowStep, 8,
|
||||
XmNcolumnType, XmALL_TYPES,
|
||||
XtVaTypedArg, XmNcellForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNcellFontList, XmRString, BOLDFONT,
|
||||
strlen(BOLDFONT) + 1,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
|
||||
XmLGridSetStrings(grid, data);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,465 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <XmL/Grid.h>
|
||||
|
||||
/* DATABASE PROTOTYPE FUNCTIONS */
|
||||
|
||||
int dbTableNumRows = 14;
|
||||
int dbTableNumColumns = 5;
|
||||
|
||||
typedef enum {
|
||||
ID, Desc, Price, Qty, UnitPrice, Buyer
|
||||
}
|
||||
DbTableColumnID;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DbTableColumnID id;
|
||||
char label[15];
|
||||
int width;
|
||||
unsigned char cellAlignment;
|
||||
Boolean cellEditable;
|
||||
} DbTableColumn;
|
||||
|
||||
DbTableColumn dbTableColumns[] =
|
||||
{
|
||||
{ Desc, "Description", 16, XmALIGNMENT_LEFT, True },
|
||||
{ Price, "Price", 9, XmALIGNMENT_LEFT, True },
|
||||
{ Qty, "Qty", 5, XmALIGNMENT_LEFT, True },
|
||||
{ UnitPrice, "Unit Prc", 9, XmALIGNMENT_LEFT, False },
|
||||
{ Buyer, "Buyer", 15, XmALIGNMENT_LEFT, True },
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char key[10];
|
||||
char desc[20];
|
||||
float price;
|
||||
int qty;
|
||||
char buyer[20];
|
||||
} DbTableRow;
|
||||
|
||||
DbTableRow dbTableRows[] =
|
||||
{
|
||||
{ "key01", "Staples", 1.32, 100, "Tim Pick" },
|
||||
{ "key02", "Notebooks", 1.11, 4, "Mary Miner" },
|
||||
{ "key03", "3-Ring Binders", 2.59, 2, "Mary Miner" },
|
||||
{ "key04", "Pads", 1.23, 3, "Tim Pick" },
|
||||
{ "key05", "Scissors", 4.41, 1, "Mary Miner" },
|
||||
{ "key06", "Pens", .29, 4, "Mary Miner" },
|
||||
{ "key07", "Pencils", .10, 5, "Tim Pick" },
|
||||
{ "key08", "Markers", .95, 3, "Mary Miner" },
|
||||
{ "key09", "Fax Paper", 3.89, 100, "Bob Coal" },
|
||||
{ "key10", "3.5\" Disks", 15.23, 30, "Tim Pick" },
|
||||
{ "key11", "8mm Tape", 32.22, 2, "Bob Coal" },
|
||||
{ "key12", "Toner", 35.69, 1, "Tim Pick" },
|
||||
{ "key13", "Paper Cups", 4.25, 3, "Bob Coal" },
|
||||
{ "key14", "Paper Clips", 2.09, 3, "Tim Pick" },
|
||||
};
|
||||
|
||||
DbTableRow *dbFindRow(rowKey)
|
||||
char *rowKey;
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dbTableNumRows; i++)
|
||||
if (!strcmp(rowKey, dbTableRows[i].key))
|
||||
return &dbTableRows[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dbCompareRowKeys(userData, l, r)
|
||||
void *userData;
|
||||
void *l;
|
||||
void *r;
|
||||
{
|
||||
DbTableRow *dbRow1, *dbRow2;
|
||||
float u1, u2;
|
||||
|
||||
dbRow1 = dbFindRow(*(char **)l);
|
||||
dbRow2 = dbFindRow(*(char **)r);
|
||||
switch ((int)userData)
|
||||
{
|
||||
case Desc:
|
||||
return strcmp(dbRow1->desc, dbRow2->desc);
|
||||
case Price:
|
||||
u1 = dbRow1->price - dbRow2->price;
|
||||
if (u1 < 0)
|
||||
return -1;
|
||||
else if (u1 == 0)
|
||||
return 0;
|
||||
return 1;
|
||||
case Qty:
|
||||
return dbRow1->qty - dbRow2->qty;
|
||||
case UnitPrice:
|
||||
u1 = dbRow1->price / (float)dbRow1->qty;
|
||||
u2 = dbRow2->price / (float)dbRow2->qty;
|
||||
if (u1 < u2)
|
||||
return -1;
|
||||
else if (u1 == u2)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
case Buyer:
|
||||
return strcmp(dbRow1->buyer, dbRow2->buyer);
|
||||
}
|
||||
return (int)(dbRow1 - dbRow2);
|
||||
}
|
||||
|
||||
char **dbGetRowKeysSorted(sortColumnID)
|
||||
int sortColumnID;
|
||||
{
|
||||
char **keys;
|
||||
int i;
|
||||
|
||||
keys = (char **)malloc(sizeof(char *) * dbTableNumRows);
|
||||
for (i = 0; i < dbTableNumRows; i++)
|
||||
keys[i] = dbTableRows[i].key;
|
||||
XmLSort(keys, dbTableNumRows, sizeof(char *),
|
||||
dbCompareRowKeys, (void *)sortColumnID);
|
||||
return keys;
|
||||
}
|
||||
|
||||
/* GRID FUNCTIONS */
|
||||
|
||||
void setRowKeysInGridSorted(grid, sortColumnID)
|
||||
Widget grid;
|
||||
int sortColumnID;
|
||||
{
|
||||
char **keys;
|
||||
int i;
|
||||
|
||||
keys = dbGetRowKeysSorted(sortColumnID);
|
||||
/* Place a pointer to each row key in each rows userData */
|
||||
for (i = 0; i < dbTableNumRows; i++)
|
||||
XtVaSetValues(grid,
|
||||
XmNrow, i,
|
||||
XmNrowUserData, (XtPointer)keys[i],
|
||||
NULL);
|
||||
free((char *)keys);
|
||||
}
|
||||
|
||||
void cellSelect(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridColumn column;
|
||||
XtPointer columnUserData;
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
|
||||
if (cbs->rowType != XmHEADING)
|
||||
return;
|
||||
|
||||
/* Cancel any edits in progress */
|
||||
XmLGridEditCancel(w);
|
||||
|
||||
column = XmLGridGetColumn(w, cbs->columnType, cbs->column);
|
||||
XtVaGetValues(w,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcolumnUserData, &columnUserData,
|
||||
NULL);
|
||||
XtVaSetValues(w,
|
||||
XmNcolumn, cbs->column,
|
||||
XmNcolumnSortType, XmSORT_ASCENDING,
|
||||
NULL);
|
||||
setRowKeysInGridSorted(w, (DbTableColumnID)columnUserData);
|
||||
XmLGridRedrawAll(w);
|
||||
}
|
||||
|
||||
void cellDraw(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridDrawStruct *ds;
|
||||
XmLGridRow row;
|
||||
XmLGridColumn column;
|
||||
XtPointer rowUserData, columnUserData;
|
||||
DbTableRow *dbRow;
|
||||
XRectangle cellRect;
|
||||
int horizMargin, vertMargin;
|
||||
XmString str;
|
||||
char buf[50];
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
if (cbs->rowType != XmCONTENT)
|
||||
return;
|
||||
|
||||
ds = cbs->drawInfo;
|
||||
|
||||
/* Retrieve userData from the cells row */
|
||||
row = XmLGridGetRow(w, cbs->rowType, cbs->row);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNrowUserData, &rowUserData,
|
||||
NULL);
|
||||
|
||||
/* Retrieve userData from cells column */
|
||||
column = XmLGridGetColumn(w, cbs->columnType, cbs->column);
|
||||
XtVaGetValues(w,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcolumnUserData, &columnUserData,
|
||||
NULL);
|
||||
|
||||
/* Retrieve the cells value from the database */
|
||||
dbRow = dbFindRow((char *)rowUserData);
|
||||
switch ((DbTableColumnID)columnUserData)
|
||||
{
|
||||
case Desc:
|
||||
sprintf(buf, "%s", dbRow->desc);
|
||||
break;
|
||||
case Price:
|
||||
sprintf(buf, "$%4.2f", dbRow->price);
|
||||
break;
|
||||
case Qty:
|
||||
sprintf(buf, "%d", dbRow->qty);
|
||||
break;
|
||||
case UnitPrice:
|
||||
sprintf(buf, "$%4.2f", dbRow->price / (float)dbRow->qty);
|
||||
break;
|
||||
case Buyer:
|
||||
sprintf(buf, "%s", dbRow->buyer);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Compensate for cell margins */
|
||||
cellRect = *ds->cellRect;
|
||||
horizMargin = ds->leftMargin + ds->rightMargin;
|
||||
vertMargin = ds->topMargin + ds->bottomMargin;
|
||||
if (horizMargin >= (int)cellRect.width ||
|
||||
vertMargin >= (int)cellRect.height)
|
||||
return;
|
||||
cellRect.x += ds->leftMargin;
|
||||
cellRect.y += ds->topMargin;
|
||||
cellRect.width -= horizMargin;
|
||||
cellRect.height -= vertMargin;
|
||||
|
||||
/* Draw the string */
|
||||
str = XmStringCreateSimple(buf);
|
||||
if (ds->drawSelected == True)
|
||||
XSetForeground(XtDisplay(w), ds->gc, ds->selectForeground);
|
||||
else
|
||||
XSetForeground(XtDisplay(w), ds->gc, ds->foreground);
|
||||
XmLStringDraw(w, str, ds->stringDirection, ds->fontList,
|
||||
ds->alignment, ds->gc, &cellRect, cbs->clipRect);
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
void cellEdit(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData;
|
||||
XtPointer callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
XmLGridColumn column;
|
||||
XtPointer rowUserData, columnUserData;
|
||||
DbTableRow *dbRow;
|
||||
Widget text;
|
||||
float f;
|
||||
int i;
|
||||
char *value;
|
||||
Boolean redrawRow;
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
|
||||
/* For a production version, this function should also
|
||||
handle XmCR_EDIT_INSERT by retrieving the current value
|
||||
from the database and performing an XmTextSetString on
|
||||
the text widget in the grid with that value. This allows
|
||||
a user to hit insert or F2 to modify an existing cell value */
|
||||
|
||||
if (cbs->reason != XmCR_EDIT_COMPLETE)
|
||||
return;
|
||||
|
||||
/* Get the value the user just typed in */
|
||||
XtVaGetValues(w,
|
||||
XmNtextWidget, &text,
|
||||
NULL);
|
||||
value = XmTextGetString(text);
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
/* Retrieve userData from the cells row */
|
||||
row = XmLGridGetRow(w, cbs->rowType, cbs->row);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNrowUserData, &rowUserData,
|
||||
NULL);
|
||||
|
||||
/* Retrieve userData from cells column */
|
||||
column = XmLGridGetColumn(w, cbs->columnType, cbs->column);
|
||||
XtVaGetValues(w,
|
||||
XmNcolumnPtr, column,
|
||||
XmNcolumnUserData, &columnUserData,
|
||||
NULL);
|
||||
|
||||
/* Set new value in the database */
|
||||
redrawRow = False;
|
||||
dbRow = dbFindRow((char *)rowUserData);
|
||||
switch ((DbTableColumnID)columnUserData)
|
||||
{
|
||||
case Desc:
|
||||
if ((int)strlen(value) < 20)
|
||||
strcpy(dbRow->desc, value);
|
||||
break;
|
||||
case Price:
|
||||
if (sscanf(value, "%f", &f) == 1)
|
||||
{
|
||||
dbRow->price = f;
|
||||
redrawRow = True;
|
||||
}
|
||||
break;
|
||||
case Qty:
|
||||
if (sscanf(value, "%d", &i) == 1)
|
||||
{
|
||||
dbRow->qty = i;
|
||||
redrawRow = True;
|
||||
}
|
||||
break;
|
||||
case Buyer:
|
||||
if ((int)strlen(value) < 20)
|
||||
strcpy(dbRow->buyer, value);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Redraw the row if we need to redisplay unit price */
|
||||
if (redrawRow == True)
|
||||
XmLGridRedrawRow(w, cbs->rowType, cbs->row);
|
||||
|
||||
/* Set the cellString to NULL - its is set to the value the
|
||||
user typed in the text widget at this point */
|
||||
XtVaSetValues(w,
|
||||
XmNrow, cbs->row,
|
||||
XmNcolumn, cbs->column,
|
||||
XmNcellString, NULL,
|
||||
NULL);
|
||||
|
||||
XtFree(value);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, grid;
|
||||
XmString str;
|
||||
int i;
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid6", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, shell,
|
||||
XmNhorizontalSizePolicy, XmVARIABLE,
|
||||
XmNvisibleRows, 10,
|
||||
XmNvsbDisplayPolicy, XmSTATIC,
|
||||
XmNselectionPolicy, XmSELECT_NONE,
|
||||
XmNshadowThickness, 0,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
NULL);
|
||||
XtAddCallback(grid, XmNcellDrawCallback, cellDraw, NULL);
|
||||
XtAddCallback(grid, XmNeditCallback, cellEdit, NULL);
|
||||
XtAddCallback(grid, XmNselectCallback, cellSelect, NULL);
|
||||
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
|
||||
XmLGridAddColumns(grid, XmCONTENT, -1, dbTableNumColumns);
|
||||
|
||||
/* Setup columns and column cell defaults based on */
|
||||
/* database description */
|
||||
for (i = 0; i < dbTableNumColumns; i++)
|
||||
{
|
||||
/* Set the width and the id on the column */
|
||||
XtVaSetValues(grid,
|
||||
XmNcolumn, i,
|
||||
XmNcolumnUserData, (XtPointer)dbTableColumns[i].id,
|
||||
XmNcolumnWidth, dbTableColumns[i].width,
|
||||
NULL);
|
||||
|
||||
/* Set the default cell alignment and editibility for */
|
||||
/* cells in the column */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumn, i,
|
||||
XmNcellAlignment, dbTableColumns[i].cellAlignment,
|
||||
XmNcellEditable, dbTableColumns[i].cellEditable,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Add the heading row */
|
||||
XmLGridAddRows(grid, XmHEADING, -1, 1);
|
||||
|
||||
/* Set the column headings */
|
||||
for (i = 0; i < dbTableNumColumns; i++)
|
||||
{
|
||||
/* Set the column heading label */
|
||||
str = XmStringCreateSimple(dbTableColumns[i].label);
|
||||
XtVaSetValues(grid,
|
||||
XmNrowType, XmHEADING,
|
||||
XmNrow, 0,
|
||||
XmNcolumn, i,
|
||||
XmNcellString, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
}
|
||||
|
||||
/* Set cell defaults for content rows */
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
XmNcellMarginLeft, 1,
|
||||
XmNcellMarginRight, 1,
|
||||
NULL);
|
||||
|
||||
XmLGridAddRows(grid, XmCONTENT, -1, dbTableNumRows);
|
||||
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
|
||||
/* Set the row keys in the rows */
|
||||
setRowKeysInGridSorted(grid, Desc);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Progress.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, progress;
|
||||
|
||||
shell = XtAppInitialize(&app, "Prog1", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
progress = XtVaCreateManagedWidget("progress",
|
||||
xmlProgressWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "#000080", 8,
|
||||
XmNwidth, 300,
|
||||
XmNheight, 25,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, 50,
|
||||
NULL);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Progress.h>
|
||||
|
||||
Boolean compute();
|
||||
|
||||
Widget progress;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell;
|
||||
|
||||
shell = XtAppInitialize(&app, "Prog2", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
progress = XtVaCreateManagedWidget("progress",
|
||||
xmlProgressWidgetClass, shell,
|
||||
XmNshowTime, True,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "#800000", 8,
|
||||
XmNwidth, 300,
|
||||
XmNheight, 25,
|
||||
NULL);
|
||||
|
||||
XtAppAddWorkProc(app, compute, NULL);
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
Boolean compute(clientData)
|
||||
XtPointer clientData;
|
||||
{
|
||||
int i;
|
||||
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, 0,
|
||||
XmNcompleteValue, 7,
|
||||
NULL);
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, i,
|
||||
NULL);
|
||||
|
||||
/* perform processing */
|
||||
sleep(1);
|
||||
}
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, i,
|
||||
NULL);
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Progress.h>
|
||||
|
||||
Boolean compute();
|
||||
|
||||
Widget progress;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell;
|
||||
|
||||
shell = XtAppInitialize(&app, "Prog3", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
progress = XtVaCreateManagedWidget("progress",
|
||||
xmlProgressWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNtopShadowColor, XmRString, "#D0D0D0", 8,
|
||||
XtVaTypedArg, XmNbottomShadowColor, XmRString, "black", 6,
|
||||
XmNmeterStyle, XmMETER_BOXES,
|
||||
XmNnumBoxes, 20,
|
||||
XmNwidth, 300,
|
||||
XmNheight, 20,
|
||||
XmNshadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
XtAppAddWorkProc(app, compute, NULL);
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
Boolean compute(clientData)
|
||||
XtPointer clientData;
|
||||
{
|
||||
int i;
|
||||
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, 0,
|
||||
XmNcompleteValue, 7,
|
||||
NULL);
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, i,
|
||||
NULL);
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
XtVaSetValues(progress,
|
||||
XmNvalue, i,
|
||||
NULL);
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Tree.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, tree;
|
||||
Pixmap pixmap, pixmask;
|
||||
XmString str;
|
||||
|
||||
shell = XtAppInitialize(&app, "Tree1", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
tree = XtVaCreateManagedWidget("tree",
|
||||
xmlTreeWidgetClass, shell,
|
||||
XmNvisibleRows, 10,
|
||||
XmNwidth, 250,
|
||||
NULL);
|
||||
|
||||
XtVaSetValues(tree,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
|
||||
pixmap = XmUNSPECIFIED_PIXMAP;
|
||||
pixmask = XmUNSPECIFIED_PIXMAP;
|
||||
|
||||
str = XmStringCreateSimple("Root");
|
||||
XmLTreeAddRow(tree, 0, True, True, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Level 1 Parent");
|
||||
XmLTreeAddRow(tree, 1, True, True, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("1st Child of Level 1 Parent");
|
||||
XmLTreeAddRow(tree, 2, False, False, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("2nd Child of Level 1 Parent");
|
||||
XmLTreeAddRow(tree, 2, False, False, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Level 2 Parent");
|
||||
XmLTreeAddRow(tree, 2, True, True, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Child of Level 2 Parent");
|
||||
XmLTreeAddRow(tree, 3, False, False, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Level 1 Parent");
|
||||
XmLTreeAddRow(tree, 1, True, True, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Child of Level 1 Parent");
|
||||
XmLTreeAddRow(tree, 2, False, False, -1, pixmap, pixmask, str);
|
||||
XmStringFree(str);
|
||||
|
||||
XtVaSetValues(tree,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Tree.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, tree;
|
||||
int i, n, size;
|
||||
XmString str;
|
||||
XmLTreeRowDefinition *rows;
|
||||
static struct
|
||||
{
|
||||
Boolean expands;
|
||||
int level;
|
||||
char *string;
|
||||
} data[] =
|
||||
{
|
||||
{ True, 0, "Root" },
|
||||
{ True, 1, "Level 1 Parent" },
|
||||
{ False, 2, "1st Child of Level 1 Parent" },
|
||||
{ False, 2, "2nd Child of Level 1 Parent" },
|
||||
{ True, 2, "Level 2 Parent" },
|
||||
{ False, 3, "Child of Level 2 Parent" },
|
||||
{ True, 1, "Level 1 Parent" },
|
||||
{ False, 2, "Child of Level 1 Parent" },
|
||||
};
|
||||
|
||||
shell = XtAppInitialize(&app, "Tree2", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
tree = XtVaCreateManagedWidget("tree",
|
||||
xmlTreeWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 6,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNconnectingLineColor, XmRString, "#808080", 8,
|
||||
XmNvisibleRows, 10,
|
||||
XmNwidth, 250,
|
||||
NULL);
|
||||
XtVaSetValues(tree,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
NULL);
|
||||
|
||||
/* Create a TreeRowDefinition array from the data array */
|
||||
/* and add rows to the Tree */
|
||||
n = 8;
|
||||
size = sizeof(XmLTreeRowDefinition) * n;
|
||||
rows = (XmLTreeRowDefinition *)malloc(size);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
rows[i].level = data[i].level;
|
||||
rows[i].expands = data[i].expands;
|
||||
rows[i].isExpanded = True;
|
||||
rows[i].pixmap = XmUNSPECIFIED_PIXMAP;
|
||||
rows[i].pixmask = XmUNSPECIFIED_PIXMAP;
|
||||
rows[i].string = XmStringCreateSimple(data[i].string);
|
||||
}
|
||||
XmLTreeAddRows(tree, rows, n, -1);
|
||||
|
||||
/* Free the TreeRowDefintion array (and XmStrings) we created above */
|
||||
for (i = 0; i < n; i++)
|
||||
XmStringFree(rows[i].string);
|
||||
free((char *)rows);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <XmL/Tree.h>
|
||||
|
||||
#define sphere_width 16
|
||||
#define sphere_height 16
|
||||
static unsigned char sphere_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0x38, 0x3f,
|
||||
0xb8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf0, 0x1f, 0xe0, 0x0f,
|
||||
0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
#define monitor_width 16
|
||||
#define monitor_height 16
|
||||
static unsigned char monitor_bits[] = {
|
||||
0x00, 0x00, 0xf8, 0x3f, 0xf8, 0x3f, 0x18, 0x30, 0x58, 0x37, 0x18, 0x30,
|
||||
0x58, 0x37, 0x18, 0x30, 0xf8, 0x3f, 0xf8, 0x3f, 0x80, 0x03, 0x80, 0x03,
|
||||
0xf0, 0x1f, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, tree;
|
||||
XmLTreeRowDefinition *rows;
|
||||
Pixmap monitorPixmap, spherePixmap;
|
||||
Pixel black, white;
|
||||
int i, n, size;
|
||||
static struct
|
||||
{
|
||||
Boolean expands;
|
||||
int level;
|
||||
char *string;
|
||||
} data[] =
|
||||
{
|
||||
{ True, 0, "Root" },
|
||||
{ True, 1, "Parent A" },
|
||||
{ False, 2, "Node A1" },
|
||||
{ False, 2, "Node A2" },
|
||||
{ True, 2, "Parent B" },
|
||||
{ False, 3, "Node B1" },
|
||||
{ False, 3, "Node B2" },
|
||||
{ True, 1, "Parent C" },
|
||||
{ False, 2, "Node C1" },
|
||||
{ True, 1, "Parent D" },
|
||||
{ False, 2, "Node D1" },
|
||||
};
|
||||
|
||||
shell = XtAppInitialize(&app, "Tree3", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
black = BlackPixelOfScreen(XtScreen(shell));
|
||||
white = WhitePixelOfScreen(XtScreen(shell));
|
||||
spherePixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
sphere_bits, sphere_width, sphere_height,
|
||||
black, white,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
monitorPixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
monitor_bits, monitor_width, monitor_height,
|
||||
black, white,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
|
||||
/* Create a Tree with 3 columns and 1 heading row in multiple */
|
||||
/* select mode. We also set globalPixmapWidth and height here */
|
||||
/* which specifys that every Pixmap we set on the Tree will be */
|
||||
/* the size specified (16x16). This will increase performance. */
|
||||
tree = XtVaCreateManagedWidget("tree",
|
||||
xmlTreeWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNconnectingLineColor, XmRString, "#808080", 8,
|
||||
XmNallowColumnResize, True,
|
||||
XmNheadingRows, 1,
|
||||
XmNvisibleRows, 14,
|
||||
XmNcolumns, 3,
|
||||
XmNvisibleColumns, 5,
|
||||
XmNsimpleWidths, "12c 8c 10c",
|
||||
XmNsimpleHeadings, "All Folders|SIZE|DATA2",
|
||||
XmNselectionPolicy, XmSELECT_MULTIPLE_ROW,
|
||||
XmNhighlightRowMode, True,
|
||||
XmNglobalPixmapWidth, 16,
|
||||
XmNglobalPixmapHeight, 16,
|
||||
NULL);
|
||||
|
||||
/* Set default values for new cells (the cells in the content rows) */
|
||||
XtVaSetValues(tree,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
NULL);
|
||||
|
||||
/* Create a TreeRowDefinition array from the data array */
|
||||
/* and add rows to the Tree */
|
||||
n = 11;
|
||||
size = sizeof(XmLTreeRowDefinition) * n;
|
||||
rows = (XmLTreeRowDefinition *)malloc(size);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
rows[i].level = data[i].level;
|
||||
rows[i].expands = data[i].expands;
|
||||
rows[i].isExpanded = True;
|
||||
if (data[i].expands)
|
||||
rows[i].pixmap = spherePixmap;
|
||||
else
|
||||
rows[i].pixmap = monitorPixmap;
|
||||
rows[i].pixmask = XmUNSPECIFIED_PIXMAP;
|
||||
rows[i].string = XmStringCreateSimple(data[i].string);
|
||||
}
|
||||
XmLTreeAddRows(tree, rows, n, -1);
|
||||
|
||||
/* Free the TreeRowDefintion array we created above and set strings */
|
||||
/* in column 1 and 2 */
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
XmStringFree(rows[i].string);
|
||||
XmLGridSetStringsPos(tree, XmCONTENT, i, XmCONTENT, 1, "1032|1123");
|
||||
}
|
||||
free((char *)rows);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,295 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <XmL/Grid.h>
|
||||
#include <XmL/Tree.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
|
||||
void rowExpand();
|
||||
void rowCollapse();
|
||||
void rowDelete();
|
||||
void cellSelect();
|
||||
|
||||
Widget grid;
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, tree;
|
||||
XmString str;
|
||||
|
||||
shell = XtAppInitialize(&app, "Tree4", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
/* Add Tree to left of Form */
|
||||
tree = XtVaCreateManagedWidget("tree",
|
||||
xmlTreeWidgetClass, form,
|
||||
XmNhorizontalSizePolicy, XmCONSTANT,
|
||||
XmNautoSelect, False,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNconnectingLineColor, XmRString, "#808080", 8,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, 45,
|
||||
NULL);
|
||||
XtVaSetValues(tree,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
NULL);
|
||||
|
||||
/* Add a single row containing the root path to the Tree */
|
||||
str = XmStringCreateSimple("/");
|
||||
XmLTreeAddRow(tree, 1, True, False, 0,
|
||||
XmUNSPECIFIED_PIXMAP, XmUNSPECIFIED_PIXMAP, str);
|
||||
XmStringFree(str);
|
||||
XtVaSetValues(tree,
|
||||
XmNrow, 0,
|
||||
XmNrowUserData, strdup("/"),
|
||||
NULL);
|
||||
|
||||
XtAddCallback(tree, XmNexpandCallback, rowExpand, NULL);
|
||||
XtAddCallback(tree, XmNcollapseCallback, rowCollapse, NULL);
|
||||
XtAddCallback(tree, XmNdeleteCallback, rowDelete, NULL);
|
||||
XtAddCallback(tree, XmNselectCallback, cellSelect, NULL);
|
||||
|
||||
/* Add a Grid to the right of the Form and set cell defaults */
|
||||
grid = XtVaCreateManagedWidget("grid",
|
||||
xmlGridWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XmNcolumns, 3,
|
||||
XmNsimpleWidths, "24c 12c 10c",
|
||||
XmNsimpleHeadings, "Name|Type|Size",
|
||||
XmNvisibleColumns, 6,
|
||||
XmNallowColumnResize, True,
|
||||
XmNheadingRows, 1,
|
||||
XmNvisibleRows, 16,
|
||||
XmNhighlightRowMode, True,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, 46,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellAlignment, XmALIGNMENT_LEFT,
|
||||
NULL);
|
||||
XtVaSetValues(grid,
|
||||
XmNcellDefaults, True,
|
||||
XmNcolumn, 2,
|
||||
XmNcellAlignment, XmALIGNMENT_RIGHT,
|
||||
NULL);
|
||||
|
||||
/* Invoke the select callback for the first row in the Tree */
|
||||
/* to fill the Grid with the data for the root path */
|
||||
XmLGridSelectRow(tree, 0, True);
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
void rowExpand(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData, callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
int level, pos;
|
||||
DIR *dir;
|
||||
struct dirent *d;
|
||||
struct stat s;
|
||||
char *path, fullpath[1024];
|
||||
XmString str;
|
||||
|
||||
/* Retrieve the path of the directory expanded. This is kept */
|
||||
/* in the row's rowUserData */
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
row = XmLGridGetRow(w, XmCONTENT, cbs->row);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNrowUserData, &path,
|
||||
XmNrowLevel, &level,
|
||||
NULL);
|
||||
pos = cbs->row + 1;
|
||||
dir = opendir(path);
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
/* Add the subdirectories of the directory expanded to the Tree */
|
||||
XtVaSetValues(w,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
while (d = readdir(dir))
|
||||
{
|
||||
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
||||
continue;
|
||||
sprintf(fullpath, "%s/%s", path, d->d_name);
|
||||
if (lstat(fullpath, &s) == -1)
|
||||
continue;
|
||||
if (!S_ISDIR(s.st_mode))
|
||||
continue;
|
||||
str = XmStringCreateSimple(d->d_name);
|
||||
XmLTreeAddRow(w, level + 1, True, False, pos,
|
||||
XmUNSPECIFIED_PIXMAP, XmUNSPECIFIED_PIXMAP, str);
|
||||
XmStringFree(str);
|
||||
XtVaSetValues(w,
|
||||
XmNrow, pos,
|
||||
XmNrowUserData, strdup(fullpath),
|
||||
NULL);
|
||||
pos++;
|
||||
}
|
||||
closedir(dir);
|
||||
XtVaSetValues(w,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void rowCollapse(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData, callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
char *path;
|
||||
int i, j, level, rows;
|
||||
|
||||
/* Collapse the row by deleting the rows in the tree which */
|
||||
/* are children of the collapsed row. */
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
|
||||
XmLTreeDeleteChildren(w, cbs->row);
|
||||
}
|
||||
|
||||
void rowDelete(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData, callData;
|
||||
{
|
||||
/* Free the path contained in the rowUserData of the rows deleted */
|
||||
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
char *path;
|
||||
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
|
||||
if (cbs->rowType != XmCONTENT || cbs->reason != XmCR_DELETE_ROW)
|
||||
return;
|
||||
|
||||
row = XmLGridGetRow(w, XmCONTENT, cbs->row);
|
||||
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNrowUserData, &path,
|
||||
NULL);
|
||||
|
||||
if (path)
|
||||
free(path);
|
||||
}
|
||||
|
||||
void cellSelect(w, clientData, callData)
|
||||
Widget w;
|
||||
XtPointer clientData, callData;
|
||||
{
|
||||
XmLGridCallbackStruct *cbs;
|
||||
XmLGridRow row;
|
||||
DIR *dir;
|
||||
struct stat s;
|
||||
struct dirent *d;
|
||||
char *path, fullpath[1024], buf[256];
|
||||
int pos;
|
||||
|
||||
/* Retrieve the directory selected */
|
||||
cbs = (XmLGridCallbackStruct *)callData;
|
||||
if (cbs->rowType != XmCONTENT)
|
||||
return;
|
||||
row = XmLGridGetRow(w, XmCONTENT, cbs->row);
|
||||
XtVaGetValues(w,
|
||||
XmNrowPtr, row,
|
||||
XmNrowUserData, &path,
|
||||
NULL);
|
||||
dir = opendir(path);
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
/* Add a row for each file in the directory to the Grid */
|
||||
pos = 0;
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, True,
|
||||
NULL);
|
||||
XmLGridDeleteAllRows(grid, XmCONTENT);
|
||||
while (d = readdir(dir))
|
||||
{
|
||||
sprintf(fullpath, "%s/%s", path, d->d_name);
|
||||
if (lstat(fullpath, &s) == -1)
|
||||
continue;
|
||||
XmLGridAddRows(grid, XmCONTENT, pos, 1);
|
||||
XmLGridSetStringsPos(grid, XmCONTENT, pos, XmCONTENT, 0, d->d_name);
|
||||
if (S_ISDIR(s.st_mode))
|
||||
sprintf(buf, "Directory");
|
||||
else if (S_ISLNK(s.st_mode))
|
||||
sprintf(buf, "Link");
|
||||
else
|
||||
sprintf(buf, "File");
|
||||
XmLGridSetStringsPos(grid, XmCONTENT, pos, XmCONTENT, 1, buf);
|
||||
sprintf(buf, "%d", (int)s.st_size);
|
||||
XmLGridSetStringsPos(grid, XmCONTENT, pos, XmCONTENT, 2, buf);
|
||||
pos++;
|
||||
}
|
||||
closedir(dir);
|
||||
XtVaSetValues(grid,
|
||||
XmNlayoutFrozen, False,
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/PushB.h>
|
||||
#include <XmL/Tree.h>
|
||||
|
||||
#define sphere_width 16
|
||||
#define sphere_height 16
|
||||
static unsigned char sphere_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0x38, 0x3f,
|
||||
0xb8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x3f, 0xf0, 0x1f, 0xe0, 0x0f,
|
||||
0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
#define monitor_width 16
|
||||
#define monitor_height 16
|
||||
static unsigned char monitor_bits[] = {
|
||||
0x00, 0x00, 0xf8, 0x3f, 0xf8, 0x3f, 0x18, 0x30, 0x58, 0x37, 0x18, 0x30,
|
||||
0x58, 0x37, 0x18, 0x30, 0xf8, 0x3f, 0xf8, 0x3f, 0x80, 0x03, 0x80, 0x03,
|
||||
0xf0, 0x1f, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
#if 0
|
||||
void
|
||||
hide_cb(Widget w, XtPointer clientData, XtPointer cb_data)
|
||||
{
|
||||
Widget tree = (Widget) clientData;
|
||||
|
||||
XmLGridHideRightColumn(tree);
|
||||
}
|
||||
void
|
||||
show_cb(Widget w, XtPointer clientData, XtPointer cb_data)
|
||||
{
|
||||
Widget tree = (Widget) clientData;
|
||||
|
||||
XmLGridUnhideRightColumn(tree);
|
||||
}
|
||||
#endif /*0*/
|
||||
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, tree, form, hideB, showB;
|
||||
XmLTreeRowDefinition *rows;
|
||||
Pixmap monitorPixmap, spherePixmap;
|
||||
Pixel black, white;
|
||||
int i, n, size;
|
||||
static struct
|
||||
{
|
||||
Boolean expands;
|
||||
int level;
|
||||
char *string;
|
||||
} data[] =
|
||||
{
|
||||
{ True, 0, "Root" },
|
||||
{ True, 1, "Parent A" },
|
||||
{ False, 2, "Node A1" },
|
||||
{ False, 2, "Node A2" },
|
||||
{ True, 2, "Parent B" },
|
||||
{ False, 3, "Node B1" },
|
||||
{ False, 3, "Node B2" },
|
||||
{ True, 1, "Parent C" },
|
||||
{ False, 2, "Node C1" },
|
||||
{ True, 1, "Parent D" },
|
||||
{ False, 2, "Node D1" },
|
||||
};
|
||||
|
||||
shell = XtAppInitialize(&app, "Tree3", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
black = BlackPixelOfScreen(XtScreen(shell));
|
||||
white = WhitePixelOfScreen(XtScreen(shell));
|
||||
spherePixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
sphere_bits, sphere_width, sphere_height,
|
||||
black, white,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
monitorPixmap = XCreatePixmapFromBitmapData(XtDisplay(shell),
|
||||
DefaultRootWindow(XtDisplay(shell)),
|
||||
monitor_bits, monitor_width, monitor_height,
|
||||
black, white,
|
||||
DefaultDepthOfScreen(XtScreen(shell)));
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
#if 0
|
||||
hideB = XtVaCreateManagedWidget("hide",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XmNleftAttachment, XmATTACH_NONE,
|
||||
XmNtopAttachment, XmATTACH_POSITION,
|
||||
XmNtopPosition, 30,
|
||||
XmNbottomAttachment, XmATTACH_NONE,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
showB = XtVaCreateManagedWidget("show",
|
||||
xmPushButtonWidgetClass, form,
|
||||
XmNleftAttachment, XmATTACH_NONE,
|
||||
XmNtopAttachment, XmATTACH_POSITION,
|
||||
XmNtopPosition, 30,
|
||||
XmNbottomAttachment, XmATTACH_NONE,
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, hideB,
|
||||
NULL);
|
||||
#endif /*0*/
|
||||
|
||||
/* Create a Tree with 3 columns and 1 heading row in multiple */
|
||||
/* select mode. We also set globalPixmapWidth and height here */
|
||||
/* which specifys that every Pixmap we set on the Tree will be */
|
||||
/* the size specified (16x16). This will increase performance. */
|
||||
tree = XtVaCreateManagedWidget("tree",
|
||||
xmlTreeWidgetClass, form,
|
||||
XtVaTypedArg, XmNbackground, XmRString, "#C0C0C0", 8,
|
||||
XtVaTypedArg, XmNforeground, XmRString, "black", 6,
|
||||
XtVaTypedArg, XmNblankBackground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNselectBackground, XmRString, "#000080", 8,
|
||||
XtVaTypedArg, XmNselectForeground, XmRString, "white", 6,
|
||||
XtVaTypedArg, XmNconnectingLineColor, XmRString, "#808080", 8,
|
||||
XmNhorizontalSizePolicy, XmRESIZE_IF_POSSIBLE,
|
||||
XmNallowColumnResize, True,
|
||||
XmNheadingRows, 1,
|
||||
XmNvisibleRows, 14,
|
||||
XmNcolumns, 3,
|
||||
XmNvisibleColumns, 1,
|
||||
XmNhideUnhideButtons, True,
|
||||
XmNsimpleWidths, "80c 40c 40c",
|
||||
XmNsimpleHeadings, "All Folders|SIZE|DATA2",
|
||||
XmNselectionPolicy, XmSELECT_MULTIPLE_ROW,
|
||||
XmNhighlightRowMode, True,
|
||||
XmNglobalPixmapWidth, 16,
|
||||
XmNglobalPixmapHeight, 16,
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
#if 0
|
||||
XmNrightAttachment, XmATTACH_WIDGET,
|
||||
XmNrightWidget, showB,
|
||||
#endif /*0*/
|
||||
XmNdebugLevel, 2,
|
||||
NULL);
|
||||
|
||||
/* Set default values for new cells (the cells in the content rows) */
|
||||
XtVaSetValues(tree,
|
||||
XmNcellDefaults, True,
|
||||
XtVaTypedArg, XmNcellBackground, XmRString, "white", 6,
|
||||
XmNcellEditable, True,
|
||||
XmNcellLeftBorderType, XmBORDER_NONE,
|
||||
XmNcellRightBorderType, XmBORDER_NONE,
|
||||
XmNcellTopBorderType, XmBORDER_NONE,
|
||||
XmNcellBottomBorderType, XmBORDER_NONE,
|
||||
NULL);
|
||||
|
||||
#if 0
|
||||
XtAddCallback(hideB, XmNactivateCallback, hide_cb, (XtPointer)tree);
|
||||
XtAddCallback(showB, XmNactivateCallback, show_cb, (XtPointer)tree);
|
||||
#endif /*0*/
|
||||
|
||||
/* Create a TreeRowDefinition array from the data array */
|
||||
/* and add rows to the Tree */
|
||||
n = 11;
|
||||
size = sizeof(XmLTreeRowDefinition) * n;
|
||||
rows = (XmLTreeRowDefinition *)malloc(size);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
rows[i].level = data[i].level;
|
||||
rows[i].expands = data[i].expands;
|
||||
rows[i].isExpanded = True;
|
||||
if (data[i].expands)
|
||||
rows[i].pixmap = spherePixmap;
|
||||
else
|
||||
rows[i].pixmap = monitorPixmap;
|
||||
rows[i].pixmask = XmUNSPECIFIED_PIXMAP;
|
||||
rows[i].string = XmStringCreateSimple(data[i].string);
|
||||
}
|
||||
XmLTreeAddRows(tree, rows, n, -1);
|
||||
|
||||
/* Free the TreeRowDefintion array we created above and set strings */
|
||||
/* in column 1 and 2 */
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
XmStringFree(rows[i].string);
|
||||
XmLGridSetStringsPos(tree, XmCONTENT, i, XmCONTENT, 1, "1032|1123");
|
||||
}
|
||||
free((char *)rows);
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Mrm/MrmPublic.h>
|
||||
#include <XmL/Folder.h>
|
||||
#include <XmL/Grid.h>
|
||||
#include <XmL/Progress.h>
|
||||
#include <XmL/Tree.h>
|
||||
#include <stdio.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
String argv[];
|
||||
{
|
||||
Display *dpy;
|
||||
XtAppContext app;
|
||||
Widget toplevel, tree, shellForm;
|
||||
Pixmap pixmap;
|
||||
XmString str;
|
||||
MrmHierarchy hier;
|
||||
MrmCode clas;
|
||||
static char *files[] = {
|
||||
"uil1.uid" };
|
||||
|
||||
MrmInitialize ();
|
||||
XtToolkitInitialize();
|
||||
app = XtCreateApplicationContext();
|
||||
dpy = XtOpenDisplay(app, NULL, argv[0], "Uil1",
|
||||
NULL, 0, &argc, argv);
|
||||
if (dpy == NULL) {
|
||||
fprintf(stderr, "%s: Can't open display\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
toplevel = XtVaAppCreateShell(argv[0], NULL,
|
||||
applicationShellWidgetClass, dpy,
|
||||
XmNwidth, 400,
|
||||
XmNheight, 300,
|
||||
NULL);
|
||||
|
||||
if (MrmOpenHierarchy (1, files, NULL, &hier) != MrmSUCCESS)
|
||||
printf ("can't open hierarchy\n");
|
||||
|
||||
MrmRegisterClass(0, NULL, "XmLCreateFolder",
|
||||
XmLCreateFolder, xmlFolderWidgetClass);
|
||||
MrmRegisterClass(0, NULL, "XmLCreateGrid",
|
||||
XmLCreateGrid, xmlGridWidgetClass);
|
||||
MrmRegisterClass(0, NULL, "XmLCreateProgress",
|
||||
XmLCreateProgress, xmlProgressWidgetClass);
|
||||
MrmRegisterClass(0, NULL, "XmLCreateTree",
|
||||
XmLCreateTree, xmlTreeWidgetClass);
|
||||
|
||||
if (MrmFetchWidget(hier, "shellForm", toplevel, &shellForm,
|
||||
&clas) != MrmSUCCESS)
|
||||
printf("can't fetch shellForm\n");
|
||||
|
||||
tree = XtNameToWidget(shellForm, "*tree");
|
||||
|
||||
/* Add two rows to the Tree */
|
||||
pixmap = XmUNSPECIFIED_PIXMAP;
|
||||
str = XmStringCreateSimple("Root");
|
||||
XmLTreeAddRow(tree, 0, True, True, -1, pixmap, pixmap, str);
|
||||
XmStringFree(str);
|
||||
str = XmStringCreateSimple("Child of Root");
|
||||
XmLTreeAddRow(tree, 1, False, False, -1, pixmap, pixmap, str);
|
||||
XmStringFree(str);
|
||||
|
||||
XtManageChild(shellForm);
|
||||
XtRealizeWidget(toplevel);
|
||||
XtAppMainLoop(app);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
module uil1
|
||||
version = 'v1.0'
|
||||
names = case_sensitive
|
||||
|
||||
include file 'XmL/XmL.uih';
|
||||
|
||||
value
|
||||
grey : color('#C0C0C0', background);
|
||||
lightGrey : color('#E0E0E0', background);
|
||||
black : color('#000000', foreground);
|
||||
white : color('#FFFFFF', background);
|
||||
darkBlue : color('#000080', foreground);
|
||||
|
||||
object shellForm :
|
||||
XmForm {
|
||||
arguments {
|
||||
XmNbackground = grey;
|
||||
XmNmarginWidth = 10;
|
||||
XmNmarginHeight = 10;
|
||||
XmNshadowThickness = 0;
|
||||
};
|
||||
controls {
|
||||
user_defined folder;
|
||||
};
|
||||
};
|
||||
|
||||
object folder :
|
||||
user_defined procedure XmLCreateFolder {
|
||||
arguments {
|
||||
XmNbackground = grey;
|
||||
XmNforeground = black;
|
||||
XmNtabsPerRow = 2;
|
||||
XmNtopAttachment = XmATTACH_FORM;
|
||||
XmNbottomAttachment = XmATTACH_FORM;
|
||||
XmNleftAttachment = XmATTACH_FORM;
|
||||
XmNrightAttachment = XmATTACH_FORM;
|
||||
};
|
||||
controls {
|
||||
XmDrawnButton tabOne;
|
||||
XmDrawnButton tabTwo;
|
||||
XmDrawnButton tabThree;
|
||||
XmDrawnButton tabFour;
|
||||
XmForm folderForm;
|
||||
};
|
||||
};
|
||||
|
||||
object tabOne:
|
||||
XmDrawnButton {
|
||||
arguments {
|
||||
XmNlabelString = compound_string('Configuration');
|
||||
};
|
||||
};
|
||||
|
||||
object tabTwo:
|
||||
XmDrawnButton {
|
||||
arguments {
|
||||
XmNlabelString = compound_string('Settings');
|
||||
};
|
||||
};
|
||||
|
||||
object tabThree:
|
||||
XmDrawnButton {
|
||||
arguments {
|
||||
XmNlabelString = compound_string('Resources');
|
||||
};
|
||||
};
|
||||
|
||||
object tabFour:
|
||||
XmDrawnButton {
|
||||
arguments {
|
||||
XmNlabelString = compound_string('Hardware Types');
|
||||
};
|
||||
};
|
||||
|
||||
object folderForm :
|
||||
XmForm {
|
||||
arguments {
|
||||
XmNbackground = grey;
|
||||
XmNhorizontalSpacing = 10;
|
||||
XmNverticalSpacing = 10;
|
||||
};
|
||||
controls {
|
||||
user_defined tree;
|
||||
user_defined grid;
|
||||
user_defined progress;
|
||||
};
|
||||
};
|
||||
|
||||
object tree :
|
||||
user_defined procedure XmLCreateTree {
|
||||
arguments {
|
||||
XmNbackground = grey;
|
||||
XmNforeground = black;
|
||||
XmNleftAttachment = XmATTACH_FORM;
|
||||
XmNrightAttachment = XmATTACH_FORM;
|
||||
XmNtopAttachment = XmATTACH_FORM;
|
||||
XmNbottomAttachment = XmATTACH_POSITION;
|
||||
XmNbottomPosition = 25;
|
||||
};
|
||||
};
|
||||
|
||||
object grid :
|
||||
user_defined procedure XmLCreateGrid {
|
||||
arguments {
|
||||
XmNbackground = grey;
|
||||
XmNforeground = black;
|
||||
XmNselectBackground = darkBlue;
|
||||
XmNselectForeground = white;
|
||||
XmNleftAttachment = XmATTACH_FORM;
|
||||
XmNrightAttachment = XmATTACH_FORM;
|
||||
XmNtopAttachment = XmATTACH_POSITION;
|
||||
XmNtopPosition = 30;
|
||||
XmNbottomAttachment = XmATTACH_POSITION;
|
||||
XmNbottomPosition = 80;
|
||||
XmNcolumns = 5;
|
||||
XmNheadingRows = 1;
|
||||
XmNsimpleHeadings = "Name|Width|Height|X|Y";
|
||||
XmNsimpleWidths = "20c 10c 10c 8c 8c";
|
||||
XmNrows = 20;
|
||||
XmNleftFixedCount = 1;
|
||||
};
|
||||
};
|
||||
|
||||
object progress :
|
||||
user_defined procedure XmLCreateProgress {
|
||||
arguments {
|
||||
XmNtopShadowColor = lightGrey;
|
||||
XmNbottomShadowColor = black;
|
||||
XmNbackground = white;
|
||||
XmNforeground = darkBlue;
|
||||
XmNleftAttachment = XmATTACH_FORM;
|
||||
XmNrightAttachment = XmATTACH_FORM;
|
||||
XmNtopAttachment = XmATTACH_POSITION;
|
||||
XmNtopPosition = 85;
|
||||
XmNheight = 20;
|
||||
XmNshadowThickness = 1;
|
||||
XmNmeterStyle = MeterBoxes;
|
||||
XmNnumBoxes = 20;
|
||||
XmNvalue = 70;
|
||||
XmNcompleteValue = 200;
|
||||
};
|
||||
};
|
||||
|
||||
end module;
|
||||
@@ -1,87 +0,0 @@
|
||||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following source code is part of the Microline Widget Library.
|
||||
* The Microline widget library is made available to Mozilla developers
|
||||
* under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
* more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
* http://www.neurondata.com.
|
||||
*/
|
||||
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/DrawnB.h>
|
||||
#include <XmL/XmL.h>
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
XtAppContext app;
|
||||
Widget shell, form, button[4][5];
|
||||
int i, j;
|
||||
static int types[5] =
|
||||
{
|
||||
XmDRAWNB_ARROW,
|
||||
XmDRAWNB_ARROWLINE,
|
||||
XmDRAWNB_DOUBLEARROW,
|
||||
XmDRAWNB_SQUARE,
|
||||
XmDRAWNB_DOUBLEBAR
|
||||
};
|
||||
static int dirs[4] =
|
||||
{
|
||||
XmDRAWNB_RIGHT,
|
||||
XmDRAWNB_LEFT,
|
||||
XmDRAWNB_UP,
|
||||
XmDRAWNB_DOWN
|
||||
};
|
||||
|
||||
shell = XtAppInitialize(&app, "Grid1", NULL, 0,
|
||||
&argc, argv, NULL, NULL, 0);
|
||||
|
||||
form = XtVaCreateManagedWidget("form",
|
||||
xmFormWidgetClass, shell,
|
||||
XmNfractionBase, 5,
|
||||
XmNshadowThickness, 0,
|
||||
NULL);
|
||||
|
||||
for (i = 0 ; i < 4; i++)
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
button[i][j] = XtVaCreateManagedWidget("drawnB",
|
||||
xmDrawnButtonWidgetClass, form,
|
||||
XmNtopAttachment, XmATTACH_POSITION,
|
||||
XmNtopPosition, i,
|
||||
XmNbottomAttachment, XmATTACH_POSITION,
|
||||
XmNbottomPosition, i + 1,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
XmNleftPosition, j,
|
||||
XmNrightAttachment, XmATTACH_POSITION,
|
||||
XmNrightPosition, j + 1,
|
||||
XmNwidth, 30,
|
||||
XmNheight, 30,
|
||||
NULL);
|
||||
XmLDrawnButtonSetType(button[i][j], types[j], dirs[i]);
|
||||
}
|
||||
|
||||
XtRealizeWidget(shell);
|
||||
XtAppMainLoop(app);
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayAdd 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayAdd \- add space to an array
|
||||
.SH SYNTAX
|
||||
void XmLArrayAdd(\fIarray\fP, \fIpos\fP, \fIcount\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to add to
|
||||
.IP \fIpos\fP 1i
|
||||
position to add at
|
||||
.IP \fIcount\fP 1i
|
||||
size of space to add
|
||||
.SH DESCRIPTION
|
||||
Adds (\fIcount\fP * sizeof(void *)) bytes of space at position
|
||||
\fIpos\fP to the \fIarray\fP given. Use XmLArraySet() to set
|
||||
the values in the array after adding space.
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayDel 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayDel \- remove space from an array
|
||||
.SH SYNTAX
|
||||
int XmLArrayDel(\fIarray\fP, \fIpos\fP, \fIcount\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to remove from
|
||||
.IP \fIpos\fP 1i
|
||||
position to start removal
|
||||
.IP \fIcount\fP 1i
|
||||
size of space to remove
|
||||
.SH DESCRIPTION
|
||||
Removes (\fIcount\fP * sizeof(void *)) bytes of space at position
|
||||
\fIpos\fP from the \fIarray\fP given. This call only removes
|
||||
space from the array, it does not free individual elements.
|
||||
.SH RETURN VALUE
|
||||
0 upon success and -1 upon failure (a value passed is out of range).
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,43 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayFree 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayFree \- free an array
|
||||
.SH SYNTAX
|
||||
void XmLArrayFree(\fIarray\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to free
|
||||
.SH DESCRIPTION
|
||||
Frees the \fIarray\fP given and any space allocated by the array.
|
||||
This function does not free the individual elements of the array.
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,48 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayGet 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayGet \- retrieve a pointer from an array
|
||||
.SH SYNTAX
|
||||
void *XmLArrayGet(\fIarray\fP, \fIpos\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to retrieve from
|
||||
.IP \fIpos\fP 1i
|
||||
position of the pointer to retrieve
|
||||
.SH DESCRIPTION
|
||||
Returns the pointer at the position \fIpos\fP in the \fIarray\fP given.
|
||||
.SH RETURN VALUE
|
||||
The pointer at the given position or NULL if the position is invalid.
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,44 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayGetCount 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayGetCount \- return size of an array
|
||||
.SH SYNTAX
|
||||
int XmLArrayGetCount(\fIarray\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to query
|
||||
.SH DESCRIPTION
|
||||
Returns the size of \fIarray\fP in units of number of pointers it can hold.
|
||||
.SH RETURN VALUE
|
||||
The size of the array.
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,60 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayMove 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayMove \- move items in an array
|
||||
.SH SYNTAX
|
||||
int XmLArrayMove(\fIarray\fP, \fInewPos\fP, \fIpos\fP, \fIcount\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fInewPos\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to operate on
|
||||
.IP \fInewPos\fP 1i
|
||||
position to move to
|
||||
.IP \fIpos\fP 1i
|
||||
position to move from
|
||||
.IP \fIcount\fP 1i
|
||||
number of items to move
|
||||
.SH DESCRIPTION
|
||||
Moves \fIcount\fP pointers starting at position \fIpos\fP in the
|
||||
\fIarray\fP to the new position \fInewPos\fP. The existing pointers
|
||||
at the new location are moved down to accommodate the move. No pointers
|
||||
are overwritten by this call and the size of the array will remain
|
||||
unchanged.
|
||||
.SH RETURN VALUE
|
||||
0 upon success and -1 upon failure (a value passed is out of range).
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,60 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayNew 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayNew \- creates an array object
|
||||
.SH SYNTAX
|
||||
XmLArray XmLArrayNew(\fIautonumber\fP, \fIgrowFast\fP)
|
||||
.br
|
||||
char \fIautonumber\fP;
|
||||
.br
|
||||
char \fIgrowFast\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIautonumber\fP 1i
|
||||
If set to 1, the pointers in the array are assumed to be
|
||||
pointers to structures containing an integer as the first
|
||||
element which will be set to the position of the item
|
||||
in the array. The array will set this value with the
|
||||
current position of the element whenever position
|
||||
of the item changes. If set to 0, the array will never
|
||||
dereference the pointers contained in the array.
|
||||
.IP \fIgrowFast\fP 1i
|
||||
If set to 1, the array will grow quickly as items are added
|
||||
to it. This will cause the amount of memory the array takes
|
||||
up to usually be greater than the current space for elements.
|
||||
If set to 0, the array will always be the size of the current
|
||||
space for the elements contained in the array.
|
||||
.SH DESCRIPTION
|
||||
Creates an array object and returns it. An array object is used to
|
||||
hold an array of pointers. This object should be freed with XmLArrayFree()
|
||||
when it is no longer used.
|
||||
.SH RETURN VALUE
|
||||
The newly allocate array object.
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,60 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArrayReorder 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArrayReorder \- reorder items in an array
|
||||
.SH SYNTAX
|
||||
int XmLArrayReorder(\fIarray\fP, \fInewPositions\fP, \fIpos\fP, \fIcount\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fInewPositions\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to operate on
|
||||
.IP \fInewPositions\fP 1i
|
||||
new positions of items
|
||||
.IP \fIpos\fP 1i
|
||||
start position of items to reorder
|
||||
.IP \fIcount\fP 1i
|
||||
number of items to reorder
|
||||
.SH DESCRIPTION
|
||||
Reorders the \fIarray\fP by ordering \fIcount\fP pointers at position
|
||||
\fIpos\fP to the positions specified in the \fInewPositions\fP array.
|
||||
The newPositions array should contain numbers starting at pos and
|
||||
ending at pos + count - 1. This function does not free the newPositions
|
||||
array passed in.
|
||||
.SH RETURN VALUE
|
||||
0 upon success and -1 upon failure (a value passed is out of range).
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArraySet 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArraySet \- set a pointer element in an array
|
||||
.SH SYNTAX
|
||||
int XmLArraySet(\fIarray\fP, \fIpos\fP, \fIitem\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
void *\fIitem\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
array to set in
|
||||
.IP \fIpos\fP 1i
|
||||
position of the pointer to set
|
||||
.IP \fIitem\fP 1i
|
||||
value of the item to set
|
||||
.SH DESCRIPTION
|
||||
Sets the pointer at the position \fIpos\fP in the \fIarray\fP given to
|
||||
\fIitem\fP.
|
||||
.SH RETURN VALUE
|
||||
0 upon success and -1 upon failure (a value passed is out of range).
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X) XmLArraySort(3X)
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLArraySort 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLArraySort \- sort an array
|
||||
.SH SYNTAX
|
||||
int XmLArraySort(\fIarray\fP, \fIcompare\fP, \fIuserData\fP, \
|
||||
\fIpos\fP, \fIcount\fP)
|
||||
.br
|
||||
XmLArray \fIarray\fP;
|
||||
.br
|
||||
XmLArrayCompareFunc \fIcompare\fP;
|
||||
.br
|
||||
void *\fIuserData\fP;
|
||||
.br
|
||||
int \fIpos\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIarray\fP 1i
|
||||
the array to sort
|
||||
.IP \fIcompare\fP 1i
|
||||
the comparison function for pointers in the array
|
||||
.IP \fIuserData\fP 1i
|
||||
an application defined pointer to pass to the sort function
|
||||
.IP \fIpos\fP 1i
|
||||
start position in array to sort
|
||||
.IP \fIcount\fP 1i
|
||||
number of items in array to sort
|
||||
.SH DESCRIPTION
|
||||
Sorts \fIcount\fP number of elements starting at position
|
||||
\fIpos\fP in \fIarray\fP using the \fIcompare\fP function given.
|
||||
The \fIuserData\fP argument is passed as data to the comparison
|
||||
function.
|
||||
.SH RETURN VALUE
|
||||
0 upon success and -1 upon failure (a value passed is out of range).
|
||||
.SH "SEE ALSO"
|
||||
XmLArrayAdd(3X) XmLArrayDel(3X) XmLArrayFree(3X) XmLArrayGet(3X)
|
||||
XmLArrayGetCount(3X) XmLArrayMove(3X) XmLArrayNew(3X)
|
||||
XmLArrayReorder(3X) XmLArraySet(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLCreateFolder 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLCreateFolder \- create an instance of a Folder widget
|
||||
.SH SYNTAX
|
||||
Widget XmLCreateFolder(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
|
||||
.br
|
||||
Widget \fIparent\fP;
|
||||
.br
|
||||
char *\fIname\fP;
|
||||
.br
|
||||
ArgList \fIarglist\fP;
|
||||
.br
|
||||
Cardinal \fIargcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIparent\fP 1i
|
||||
new widgets parent widget ID
|
||||
.IP \fIname\fP 1i
|
||||
name of the newly created widget
|
||||
.IP \fIarglist\fP 1i
|
||||
resource name/value pairs
|
||||
.IP \fIargcount\fP 1i
|
||||
count of pairs in arglist
|
||||
.SH DESCRIPTION
|
||||
Creates an instance of a Folder widget and returns its widget ID.
|
||||
.SH RETURN VALUE
|
||||
The widget ID of the newly created Folder widget.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolder(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLCreateGrid 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLCreateGrid \- create an instance of a Grid widget
|
||||
.SH SYNTAX
|
||||
Widget XmLCreateGrid(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
|
||||
.br
|
||||
Widget \fIparent\fP;
|
||||
.br
|
||||
char *\fIname\fP;
|
||||
.br
|
||||
ArgList \fIarglist\fP;
|
||||
.br
|
||||
Cardinal \fIargcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIparent\fP 1i
|
||||
new widgets parent widget ID
|
||||
.IP \fIname\fP 1i
|
||||
name of the newly created widget
|
||||
.IP \fIarglist\fP 1i
|
||||
resource name/value pairs
|
||||
.IP \fIargcount\fP 1i
|
||||
count of pairs in arglist
|
||||
.SH DESCRIPTION
|
||||
Creates an instance of a Grid widget and returns its widget ID.
|
||||
.SH RETURN VALUE
|
||||
The widget ID of the newly created Grid widget.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X)
|
||||
@@ -1,55 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLCreateProgress 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLCreateProgress \- create an instance of a Progress widget
|
||||
.SH SYNTAX
|
||||
Widget XmLCreateProgress(\fIparent\fP, \fIname\fP, \fIarglist\fP,
|
||||
\fIargcount\fP)
|
||||
.br
|
||||
Widget \fIparent\fP;
|
||||
.br
|
||||
char *\fIname\fP;
|
||||
.br
|
||||
ArgList \fIarglist\fP;
|
||||
.br
|
||||
Cardinal \fIargcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIparent\fP 1i
|
||||
new widgets parent widget ID
|
||||
.IP \fIname\fP 1i
|
||||
name of the newly created widget
|
||||
.IP \fIarglist\fP 1i
|
||||
resource name/value pairs
|
||||
.IP \fIargcount\fP 1i
|
||||
count of pairs in arglist
|
||||
.SH DESCRIPTION
|
||||
Creates an instance of a Progress widget and returns its widget ID.
|
||||
.SH RETURN VALUE
|
||||
The widget ID of the newly created Progress widget.
|
||||
.SH "SEE ALSO"
|
||||
XmLProgress(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLCreateTree 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLCreateTree \- create an instance of a Tree widget
|
||||
.SH SYNTAX
|
||||
Widget XmLCreateTree(\fIparent\fP, \fIname\fP, \fIarglist\fP, \fIargcount\fP)
|
||||
.br
|
||||
Widget \fIparent\fP;
|
||||
.br
|
||||
char *\fIname\fP;
|
||||
.br
|
||||
ArgList \fIarglist\fP;
|
||||
.br
|
||||
Cardinal \fIargcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIparent\fP 1i
|
||||
new widgets parent widget ID
|
||||
.IP \fIname\fP 1i
|
||||
name of the newly created widget
|
||||
.IP \fIarglist\fP 1i
|
||||
resource name/value pairs
|
||||
.IP \fIargcount\fP 1i
|
||||
count of pairs in arglist
|
||||
.SH DESCRIPTION
|
||||
Creates an instance of a Tree widget and returns its widget ID.
|
||||
.SH RETURN VALUE
|
||||
The widget ID of the newly created Tree widget.
|
||||
.SH "SEE ALSO"
|
||||
XmLTree(3X)
|
||||
@@ -1,65 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLCvtStringToUChar 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLCvtStringToUChar \- unsigned char resource converter
|
||||
.SH SYNTAX
|
||||
Boolean XmLCvtStringToUChar(\fIdpy\fP, \fIresname\fP, \fImap\fP, \
|
||||
\fIfromVal\fP, \fItoVal\fP)
|
||||
.br
|
||||
Display *\fIdpy\fP;
|
||||
.br
|
||||
char *\fIresname\fP;
|
||||
.br
|
||||
XmLStringToUCharMap *\fImap\fP;
|
||||
.br
|
||||
XrmValuePtr \fIfromVal\fP;
|
||||
.br
|
||||
XrmValuePtr \fItoVal\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIdpy\fP 1i
|
||||
the display
|
||||
.IP \fIresname\fP 1i
|
||||
the resource name
|
||||
.IP \fImap\fP 1i
|
||||
the mappings of string to unsigned char
|
||||
.IP \fIfromVal\fP 1i
|
||||
the resource value from
|
||||
.IP \fItoVal\fP 1i
|
||||
the resource value to
|
||||
.SH DESCRIPTION
|
||||
This function can be used in a widget to perform resource conversion
|
||||
from a string to an unsigned char. This function should be called inside
|
||||
a widgets resource converter where parameters \fIdpy\fP,
|
||||
\fIfromVal\fP and \fItoVal\fP are available to be passed in. The
|
||||
\fIresname\fP parameter identifies the resource and the \fImap\fP
|
||||
array is an array of mappings from strings to unsigned chars. A
|
||||
NULL string should be used in the last array element to terminate
|
||||
the array.
|
||||
.SH RETURN VALUE
|
||||
True if conversion was successful and toVal is filled in and False if
|
||||
conversion was unsuccessful.
|
||||
@@ -1,47 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLDateDaysInMonth 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLDateDaysInMonth \- calculates number of days in month
|
||||
.SH SYNTAX
|
||||
int XmLDateDaysInMonth(\fIm\fP, \fIy\fP)
|
||||
.br
|
||||
int \fIm\fP;
|
||||
.br
|
||||
int \fIy\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIm\fP 1i
|
||||
month 1 to 12
|
||||
.IP \fIy\fP 1i
|
||||
year 1753 to 9999
|
||||
.SH DESCRIPTION
|
||||
Calculates the number of days in a given month \fIm\fP and year \fIy\fP.
|
||||
.SH RETURN VALUE
|
||||
The number of days in the given month and year. A value of -1 is
|
||||
returned if a passed value is out of range.
|
||||
.SH "SEE ALSO"
|
||||
XmLDateWeekDay(3X)
|
||||
@@ -1,52 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLDateWeekDay 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLDateWeekDay \- calculates the weekday for a given date
|
||||
.SH SYNTAX
|
||||
int XmLDateWeekDay(\fIm\fP, \fId\fP, \fIy\fP)
|
||||
.br
|
||||
int \fIm\fP;
|
||||
.br
|
||||
int \fId\fP;
|
||||
.br
|
||||
int \fIy\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIm\fP 1i
|
||||
month 1 to 12
|
||||
.IP \fId\fP 1i
|
||||
day 1 to number of days in month
|
||||
.IP \fIy\fP 1i
|
||||
year 1753 to 9999
|
||||
.SH DESCRIPTION
|
||||
Calculates the weekday for the given day \fId\fP, month \fIm\fP, and year
|
||||
\fIy\fP.
|
||||
.SH RETURN VALUE
|
||||
0 for Sunday, 1 for Monday and so on through 6 for Saturday. A value
|
||||
of -1 is returned if a passed value is out of range.
|
||||
.SH "SEE ALSO"
|
||||
XmLDateDaysInMonth(3X)
|
||||
@@ -1,54 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLDrawnButtonSetType 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLDrawnButtonSetType \- adds graphics to a DrawnButton widget
|
||||
.SH SYNTAX
|
||||
void XmLDrawnButtonSetType(\fIwidget\fP, \fIdrawnType\fP, \fIdrawnDir\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
int \fIdrawnType\fP;
|
||||
.br
|
||||
int \fIdrawnDir\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
DrawnButton widget ID
|
||||
.IP \fIdrawnType\fP 1i
|
||||
type of button to display
|
||||
.IP \fIdrawnDir\fP 1i
|
||||
direction of button to display
|
||||
.SH DESCRIPTION
|
||||
Given a \fIwidget\fP of class XmDrawnButton this function attaches
|
||||
expose and realize callbacks to the widget to display the specified graphic
|
||||
in the button. This function also sets the widget's XmNpushButtonEnabled
|
||||
resource to True. The \fIdrawnType\fP value given must be one of
|
||||
the following: XmDRAWNB_ARROW, XmDRAWNB_ARROWLINE, XmDRAWNB_DOUBLEARROW,
|
||||
XmDRAWNB_SQUARE ,XmDRAWNB_DOUBLEBAR or XmDRAWNB_STRING.
|
||||
The \fIdrawnDir\fP value given must be
|
||||
XmDRAWNB_RIGHT, XmDRAWNB_LEFT, XmDRAWNB_UP, or XmDRAWNB_DOWN.
|
||||
The graphics inside the button are drawn in the widget's foreground color.
|
||||
@@ -1,352 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolder 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolder
|
||||
.SH SYNOPSIS
|
||||
#include <XmL/Folder.h>
|
||||
.LP
|
||||
.SH DESCRIPTION
|
||||
Provides a Folder containing tabs along the top, bottom, left or
|
||||
right and an area managed by the tabs in the center. Each tab
|
||||
consists of a Primitive widget surrounded by tab decorations including
|
||||
an optional pixmap. Any non-Primitive widget children of the Folder
|
||||
are placed in the center area. The widgets contained in the tabs
|
||||
can be assigned a non-Primitive widget to display/manage when the
|
||||
tab widget is selected.
|
||||
.SS Class Information
|
||||
Folder inherits from XmManager, Constraint, Composite and Core. Its
|
||||
class pointer is xmlFolderWidgetClass. Its class name is XmLFolder.
|
||||
.SS New Resources
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Name Class
|
||||
Type Default Access
|
||||
.ft P
|
||||
XmNactiveTab XmCActiveTab
|
||||
int -1 G
|
||||
XmNautoSelect XmCAutoSelect
|
||||
Boolean True CSG
|
||||
XmNblankBackground XmCBlankBackground
|
||||
Pixel dynamic CSG
|
||||
XmNblankBackgroundPixmap XmCBlankBackgroundPixmap
|
||||
Pixmap dynamic CSG
|
||||
XmNcornerDimension XmCCornerDimension
|
||||
Dimension 2 CSG
|
||||
XmNcornerStyle XmCCornerStyle
|
||||
unsigned char XmCORNER_ARC CSG
|
||||
XmNdebugLevel XmCDebugLevel
|
||||
int 0 CSG
|
||||
XmNfontList XmCFontList
|
||||
XmFontList dynamic CSG
|
||||
XmNhighlightThickness XmCHighlightThickness
|
||||
Dimension 2 CSG
|
||||
XmNinactiveBackground XmCInactiveBackground
|
||||
Pixel dynamic CSG
|
||||
XmNinactiveForeground XmCInactiveForeground
|
||||
Pixel dynamic CSG
|
||||
XmNmarginHeight XmCMarginHeight
|
||||
Dimension 0 CSG
|
||||
XmNmarginWidth XmCMarginWidth
|
||||
Dimension 0 CSG
|
||||
XmNpixmapMargin XmCPixmapMargin
|
||||
Dimension 2 CSG
|
||||
XmNresizePolicy XmCFolderResizePolicy
|
||||
XmRFolderResizePolicy XmRESIZE_STATIC CSG
|
||||
XmNrotateWhenLeftRight XmCRotateWhenLeftRight
|
||||
Boolean True CSG
|
||||
XmNspacing XmCSpacing
|
||||
Dimension 0 CSG
|
||||
XmNtabBarHeight XmCTabBarHeight
|
||||
Dimension dynamic G
|
||||
XmNtabCount XmCTabCount
|
||||
int 0 G
|
||||
XmNtabPlacement XmCTabPlacement
|
||||
unsigned char XmFOLDER_TOP CSG
|
||||
XmNtabsPerRow XmCTabsPerRow
|
||||
int 0 CSG
|
||||
XmNtabTranslations XmCTranslations
|
||||
XtTranslations [focus translations] CG
|
||||
XmNtabWidgetList XmCReadOnly
|
||||
WidgetList dynamic G
|
||||
.fi
|
||||
.IP XmNactiveTab
|
||||
The position of the currently active tab. The first tab on the
|
||||
left has a position of 0. If no tab is active, this value equals -1.
|
||||
.IP XmNautoSelect
|
||||
If True (the default), the Folder will activate its first tab
|
||||
when it is realized. No callback is generated by this action.
|
||||
If False, no initial tab will be activated.
|
||||
.IP XmNblankBackground
|
||||
The color of the area between tabs, around tabs, and between
|
||||
tabs and the edge of the Folder.
|
||||
.IP XmNblankBackgroundPixmap
|
||||
The pixmap to display as a background (tiled) in the blank background
|
||||
area. See XmNblankBackground.
|
||||
.IP XmNcornerDimension
|
||||
If XmNcornerStyle is XmCORNER_LINE, this value is used to determine
|
||||
the length of the lines that clip the corners of the tabs. The
|
||||
greater this value is, the longer the corner lines will be. If
|
||||
XmNcornerStyle is XmCORNER_ARC, this value is used to determine
|
||||
the sizes of the arcs in the corners of the tabs. If XmNcornerStyle
|
||||
is XmCORNER_NONE, this resource has no effect.
|
||||
.IP XmNcornerStyle
|
||||
Defines the type of corners on the individual tabs. Possible values:
|
||||
|
||||
.nf
|
||||
XmCORNER_NONE /* no corners */
|
||||
XmCORNER_LINE /* corners are beveled */
|
||||
XmCORNER_ARC /* corners are round */
|
||||
.fi
|
||||
.IP XmNdebugLevel
|
||||
If set to a value greater than 0, debugging messages will be
|
||||
printed to stderr. When set to 0 (the default) only error
|
||||
messages will be generated.
|
||||
.IP XmNfontList
|
||||
The default font list for tabs created with the XmLFolderAddTab()
|
||||
functions. Changing this value does not affect existing widgets.
|
||||
If this value is NULL, a font list is obtained from the nearest
|
||||
parent that is a subclass of BulletinBoard, MenuShell, or VendorShell.
|
||||
.IP XmNhighlightThickness
|
||||
The thickness of the highlight drawn around the Primitive widget
|
||||
contained in the active tab. When a Primitive widget is added to
|
||||
the Folder, its highlightThickness is set to 0. The Folder is
|
||||
responsible for drawing the highlight in the active tab.
|
||||
This is necessary because if the Primitive widget were allowed
|
||||
to draw the highlight, it would erase the highlight with
|
||||
an incorrect color.
|
||||
.IP XmNinactiveBackground
|
||||
The background color of inactive tabs. This value is initially set
|
||||
to the background color of the Folder widget.
|
||||
.IP XmNinactiveForeground
|
||||
The foreground color of inactive tabs. This value is initially
|
||||
set to the foreground color of the Folder widget.
|
||||
.IP XmNmarginHeight
|
||||
If tab placement is on the top or bottom, this value is the margin
|
||||
between tab widgets and the top of tabs, and between tab widgets
|
||||
and the bottom of tabs. If tab placement is on the left or right,
|
||||
this value is the margin between tab widgets and the left of tabs,
|
||||
and between tab widgets and the right of tabs.
|
||||
.IP XmNmarginWidth
|
||||
If tab placement is on the top or bottom, this value is the margin
|
||||
between tab widgets and the left of tabs, and between tab widgets
|
||||
and the right of tabs. If tab placement is on the left
|
||||
or right, this value is the margin between tab widgets and the top of
|
||||
tabs and between tab widgets and bottoms of tabs.
|
||||
.IP XmNpixmapMargin
|
||||
The margin between the tab widget and any pixmap to its left.
|
||||
.IP XmNresizePolicy
|
||||
This policy determines when the Folder should perform a request
|
||||
for a new size from its parent.
|
||||
A policy of XmRESIZE_STATIC (the default) will cause the Folder
|
||||
to initially request a size which includes the preferred size of
|
||||
its children and then reject any subsequent resize requests from
|
||||
its non-tab widget children. A policy of XmRESIZE_DYNAMIC will
|
||||
cause the Folder to resize itself to include the preferred size
|
||||
of any of its children whenever its children change size. A
|
||||
policy of XmRESIZE_NONE will cause the Folder to never generate
|
||||
a resize request and also will cause it not to perform geometry
|
||||
management on its non-tab widget children. Possible values:
|
||||
|
||||
.nf
|
||||
XmRESIZE_NONE /* no resize requests and no
|
||||
placement or geometry management
|
||||
of non-tab children */
|
||||
XmRESIZE_STATIC /* initially layout to include
|
||||
preferred size of children */
|
||||
XmRESIZE_DYNAMIC /* dynamically resize as children
|
||||
request new size */
|
||||
.fi
|
||||
.IP XmNrotateWhenLeftRight
|
||||
If True, XmDrawnButton based tabs (including tabs created with the
|
||||
XmLFolderAddTab() functions) will display their text vertically
|
||||
instead of horizontally if they are placed on the left or right
|
||||
of the Folder. This occurs when the Folder's XmNtabPlacement
|
||||
resource is XmFOLDER_LEFT or XmFOLDER_RIGHT. Tabs on the
|
||||
left would have their text drawn up and tabs on the right
|
||||
would have their text drawn down. If False, tabs are left
|
||||
oriented horizontally regardless of their placement.
|
||||
.IP XmNspacing
|
||||
The amount of space between tabs.
|
||||
.IP XmNtabBarHeight
|
||||
The height, in pixels, of the tab bar. If tab placement is on
|
||||
the left or right, this value is the width of the tab bar.
|
||||
This value may not be set and is only valid after the Folder
|
||||
has been managed and has performed its layout.
|
||||
.IP XmNtabCount
|
||||
The number of tabs displayed.
|
||||
.IP XmNtabPlacement
|
||||
Where to place the tabs. Possible values:
|
||||
|
||||
.nf
|
||||
XmFOLDER_TOP /* top left to right */
|
||||
XmFOLDER_BOTTOM /* bottom left to right */
|
||||
XmFOLDER_LEFT /* left top to bottom */
|
||||
XmFOLDER_RIGHT /* right top to bottom */
|
||||
.fi
|
||||
.IP XmNtabsPerRow
|
||||
If set to 0 (the default), the Folder will place tabs in a
|
||||
single row one after another during layout. If non-zero,
|
||||
this value specifies the number of rows of tabs to appear
|
||||
in the Folder and the Folder will pad each row to the width
|
||||
of the Folder by proportionally sizing the tabs based on
|
||||
their contents and the width of the row.
|
||||
.IP XmNtabTranslations
|
||||
The translation table used to augment the translations of
|
||||
Primitive widgets added to the Folder. The Folder overrides
|
||||
the FocusIn and FocusOut translations of its Primitive widget
|
||||
children allowing it to draw and erase tab highlights.
|
||||
.IP XmNtabWidgetList
|
||||
The list of widgets contained inside the tabs. These widgets
|
||||
are subclasses of XmPrimitive.
|
||||
.SS Constraint Resources
|
||||
Folder defines the following constraint resources.
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Name Class
|
||||
Type Default Access
|
||||
.ft P
|
||||
XmNtabFreePixmaps XmCTabFreePixmap
|
||||
Boolean False CSG
|
||||
XmNtabInactivePixmap XmCTabInactivePixmap
|
||||
Pixmap XmUNSPECIFIED_PIXMAP CSG
|
||||
XmNtabManagedName XmCTabManagedName
|
||||
String NULL CSG
|
||||
XmNtabManagedWidget XmCTabManagedWidget
|
||||
Widget NULL CSG
|
||||
XmNtabPixmap XmCTabPixmap
|
||||
Pixmap XmUNSPECIFIED_PIXMAP CSG
|
||||
.fi
|
||||
.IP XmNtabFreePixmaps
|
||||
If True, the Folder will call XFreePixmap on the XmNtabPixmap and
|
||||
XmNtabInactivePixmap pixmaps when this widget is destroyed.
|
||||
This value is set to True for tabs created by the
|
||||
XmLFolderAddBitmapTab() functions.
|
||||
.IP XmNtabInactivePixmap
|
||||
The pixmap to appear in the left of the tab when the tab is inactive.
|
||||
.IP XmNtabManagedName
|
||||
By setting a managed name on a tab widget and setting the same
|
||||
managed name on a Manager widget, you specify that the tab
|
||||
manages the Manager widget. You can also specify that a tab
|
||||
manages a specific Manager widget by setting the managed name
|
||||
on the tab widget to the name (XtName) of the Manager widget.
|
||||
If a tab widget has a managed name, the XmNtabManagedWidget
|
||||
resource of the tab widget is ignored.
|
||||
.IP XmNtabManagedWidget
|
||||
Specifies a widget to be managed when this widget is activated.
|
||||
When this widget is deactivated, its managed widget will be
|
||||
unmanaged. This resource allows Manager widgets contained in the
|
||||
center of the Folder to be attached to tabs, so when a user
|
||||
selects a tab its attached Manager widget will be displayed on
|
||||
the screen.
|
||||
.IP XmNtabPixmap
|
||||
The pixmap to appear in the left of the tab when the tab is active.
|
||||
.SS Callback Resources
|
||||
Folder defines the following callback resources.
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Callback Reason
|
||||
.ft P
|
||||
XmNactivateCallback XmCR_ACTIVATE
|
||||
.fi
|
||||
.SS Callback Structure
|
||||
Each callback function is passed a pointer to the structure shown below.
|
||||
|
||||
.nf
|
||||
typedef struct
|
||||
{
|
||||
int reason; /* callback reason */
|
||||
XEvent *event; /* event callback or NULL */
|
||||
int pos; /* position of tab to act */
|
||||
int allowActivate; /* allow/disallow act (1/0) */
|
||||
} XmLFolderCallbackStruct;
|
||||
.fi
|
||||
|
||||
pos will be set to the position of the tab (with 0 as the first tab
|
||||
on the left) to activate for XmNactivateCallback callbacks.
|
||||
If allowActivate is set to 0 by the callback function, the tab will not
|
||||
be activated and the attempt to activate the given tab will be rejected.
|
||||
.SS Inherited Resources
|
||||
Folder inherits the resources shown below.
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Resource From Resource From
|
||||
.ft P
|
||||
XmNaccelerators Core XmNinitialResourcePersist Core
|
||||
XmNancestorSensitive Core XmNinsertPosition Composite
|
||||
XmNbackground Core XmNmappedWhenManaged Core
|
||||
XmNbackgroundPixmap Core XmNnavagationType Manager
|
||||
XmNborderColor Core XmNnumChildren Composite
|
||||
XmNborderPixmap Core XmNscreen Core
|
||||
XmNborderWidth Core XmNsensitive Core
|
||||
XmNbottomShadowColor Manager XmNshadowThicknses Manager
|
||||
XmNbottomShadowPixmap Manager XmNstringDirection Manager
|
||||
XmNchildren Composite XmNtopShadowColor Manager
|
||||
XmNcolormap Core XmNtopShadowPixmap Manager
|
||||
XmNdepth Core XmNtranslations Core
|
||||
XmNdestroyCallback Core XmNtraversalOn Manager
|
||||
XmNforeground Manager XmNunitType Manager
|
||||
XmNheight Core XmNuserData Manager
|
||||
XmNhelpCallback Manager XmNwidth Core
|
||||
XmNhighlightColor Manager XmNx Core
|
||||
XmNhighlightPixmap Manager XmNy Core
|
||||
.fi
|
||||
|
||||
.SS Folder Translations
|
||||
Folder defines the translations shown below.
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Event Action
|
||||
.ft P
|
||||
BSelect Press XmLFolderActivate()
|
||||
.fi
|
||||
.SS Folder Primitive Translations
|
||||
Folder overrides the translations shown below for all of
|
||||
its Primitive widget children.
|
||||
|
||||
.nf
|
||||
.ft B
|
||||
Event Action
|
||||
.ft P
|
||||
FocusIn PrimitiveFocusIn() XmLFolderPrimFocusIn()
|
||||
FocusOut PrimtiveFocusOut() XmLFolderPrimFocusOut()
|
||||
.fi
|
||||
.SS Action Routines
|
||||
Folder defines the actions shown below.
|
||||
.IP XmLFolderActivate()
|
||||
Activates the tab at the location of the event passed to the action routine.
|
||||
.IP XmLFolderPrimFocusIn()
|
||||
Draws a highlight around the given widget.
|
||||
.IP XmLFolderPrimFocusOut()
|
||||
Erases the highlight around the given widget.
|
||||
.SH "SEE ALSO"
|
||||
XmLCreateFolder(3X) XmLFolderAddBitmapTab(3X) XmLFolderAddBitmapTabForm(3X)
|
||||
XmLFolderAddTab(3X) XmLFolderAddTabForm(3X) XmLFolderSetActiveTab(3X)
|
||||
@@ -1,60 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolderAddBitmapTab 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolderAddBitmapTab \- add a tab to a Folder containing a string and bitmap
|
||||
.SH SYNTAX
|
||||
Widget XmLFolderAddBitmapTab(\fIwidget\fP, \fIstring\fP, \
|
||||
\fIbitmapBits\fP, \fIbitmapWidth\fP, \fIbitmapHeight\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
XmString \fIstring\fP;
|
||||
.br
|
||||
char *\fIbitmapBits\fP;
|
||||
.br
|
||||
int \fIbitmapWidth\fP;
|
||||
.br
|
||||
int \fIbitmapHeight\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Folder widget ID
|
||||
.IP \fIstring\fP 1i
|
||||
string to display in the tab
|
||||
.IP \fIbitmapBits\fP 1i
|
||||
bitmap to display in the tab
|
||||
.IP \fIbitmapWidth\fP 1i
|
||||
width of the bitmap in pixels
|
||||
.IP \fIbitmapHeight\fP 1i
|
||||
height of the bitmap in pixels
|
||||
.SH DESCRIPTION
|
||||
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP and
|
||||
\fIbitmap\fP specified.
|
||||
.SH RETURN VALUE
|
||||
Returns the widget ID of the DrawnButton widget contained in the tab.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolderAddBitmapTabForm(3X) XmLFolderAddTab(3X) XmLFolder(3X)
|
||||
@@ -1,62 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolderAddBitmapTabForm 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolderAddBitmapTabForm \- add a tab to a Folder containing a string
|
||||
and bitmap and a form managed by the tab
|
||||
.SH SYNTAX
|
||||
Widget XmLFolderAddBitmapTabForm(\fIwidget\fP, \fIstring\fP, \
|
||||
\fIbitmapBits\fP, \fIbitmapWidth\fP, \fIbitmapHeight\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
XmString \fIstring\fP;
|
||||
.br
|
||||
char *\fIbitmapBits\fP;
|
||||
.br
|
||||
int \fIbitmapWidth\fP;
|
||||
.br
|
||||
int \fIbitmapHeight\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Folder widget ID
|
||||
.IP \fIstring\fP 1i
|
||||
string to display in the tab
|
||||
.IP \fIbitmapBits\fP 1i
|
||||
bitmap to display in the tab
|
||||
.IP \fIbitmapWidth\fP 1i
|
||||
width of the bitmap in pixels
|
||||
.IP \fIbitmapHeight\fP 1i
|
||||
height of the bitmap in pixels
|
||||
.SH DESCRIPTION
|
||||
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP and
|
||||
\fIbitmap\fP specified and adds a form (XmForm widget) to the Folder
|
||||
which is managed by that tab.
|
||||
.SH RETURN VALUE
|
||||
Returns the widget ID of the Form widget managed by the new tab.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolderAddTab(3X) XmLFolder(3X)
|
||||
@@ -1,46 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolderAddTab 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolderAddTab \- add a tab to a Folder containing a string
|
||||
.SH SYNTAX
|
||||
Widget XmLFolderAddTab(\fIwidget\fP, \fIstring\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
XmString \fIstring\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Folder widget ID
|
||||
.IP \fIstring\fP 1i
|
||||
string to display in the tab
|
||||
.SH DESCRIPTION
|
||||
Adds a tab to a Folder containing the \fIstring\fP specified.
|
||||
.SH RETURN VALUE
|
||||
Returns the widget ID of the DrawnButton widget contained in the tab.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolderAddBitmapTab(3X) XmLFolder(3X)
|
||||
@@ -1,49 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolderAddTabForm 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolderAddTabForm \- add a tab to a Folder containing a string and
|
||||
a form managed by the tab
|
||||
.SH SYNTAX
|
||||
Widget XmLFolderAddTabForm(\fIwidget\fP, \fIstring\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
XmString \fIstring\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Folder widget ID
|
||||
.IP \fIstring\fP 1i
|
||||
string to display in the tab
|
||||
.SH DESCRIPTION
|
||||
Adds a tab to the Folder \fIwidget\fP containing the \fIstring\fP
|
||||
specified and adds a form (XmForm widget) to the Folder which is
|
||||
managed by that tab.
|
||||
.SH RETURN VALUE
|
||||
Returns the widget ID of the Form widget managed by the new tab.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolderAddBitmapTabForm(3X) XmLFolder(3X)
|
||||
@@ -1,52 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFolderSetActiveTab 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFolderSetActiveTab \- activate a tab at a given position
|
||||
.SH SYNTAX
|
||||
void XmLFolderSetActiveTab(\fIwidget\fP, \fIposition\fP, \fInotify\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
int \fIposition\fP;
|
||||
.br
|
||||
Boolean \fInotify\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Folder widget ID
|
||||
.IP \fIposition\fP 1i
|
||||
active tab position
|
||||
.IP \fInotify\fP 1i
|
||||
if True, activate callback will be called
|
||||
.SH DESCRIPTION
|
||||
Activates a tab at the given \fIposition\fP. If the activated tab
|
||||
manages a widget, that widget will be managed and any other widgets
|
||||
managed by other tabs will be unmanaged. The Folder's XmNactivateCallback
|
||||
callbacks will be called if \fInotify\fP is True and the position passed
|
||||
is different from the current active position.
|
||||
.SH "SEE ALSO"
|
||||
XmLFolder(3X)
|
||||
@@ -1,42 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFontListCopyDefault 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFontListCopyDefault \- returns a copy of the default font list for a widget
|
||||
.SH SYNTAX
|
||||
XmLFontList XmLFontListCopyDefault(\fIwidget\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
widget to retrieve default font list for
|
||||
.SH DESCRIPTION
|
||||
Returns a copy of the default font list for the given \fIwidget\fP.
|
||||
The default font list is found by looking for the font list default
|
||||
of the nearest BulletinBoard, MenuShell or VendorShell parent.
|
||||
.SH RETURN VALUE
|
||||
A copy of the default font list for the given \fIwidget\fP.
|
||||
@@ -1,56 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLFontListGetDimensions 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLFontListGetDimensions \- calculates overall width and height of characters
|
||||
in a font list
|
||||
.SH SYNTAX
|
||||
void XmLFontListGetDimensions(\fIfontList\fP, \fIwidth\fP, \
|
||||
\fIheight\fP, \fIuseAverageWidth\fP)
|
||||
.br
|
||||
XmFontList \fIfontList\fP;
|
||||
.br
|
||||
short *\fIwidth\fP;
|
||||
.br
|
||||
short *\fIheight\fP;
|
||||
.br
|
||||
Boolean \fIuseAverageWidth\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIfontList\fP 1i
|
||||
font list
|
||||
.IP \fIwidth\fP 1i
|
||||
maximum or average character width in fontlist
|
||||
.IP \fIheight\fP 1i
|
||||
maximum character height in fontlist
|
||||
.IP \fIuseAverageWidth\fP 1i
|
||||
if True, return average glyph width instead of maximum glyph width
|
||||
.SH DESCRIPTION
|
||||
Calculates the overall \fIwidth\fP and \fIheight\fP of the characters in
|
||||
a given \fIfontList\fP. The height returned is the height of the tallest
|
||||
glyph. If \fIuseAverageWidth\fP is False, the width returned is the
|
||||
width of the widest glyph. If True, the width returned is the average
|
||||
width of all of the glyphs.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,61 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridAddColumns 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridAddColumns \- add columns to a Grid
|
||||
.SH SYNTAX
|
||||
void XmLGridAddColumns(\fIwidget\fP, \fItype\fP, \
|
||||
\fIposition\fP, \fIcount\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.br
|
||||
int \fIposition\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of column
|
||||
.IP \fIposition\fP 1i
|
||||
position of first column
|
||||
.IP \fIcount\fP 1i
|
||||
number of columns to add
|
||||
.SH DESCRIPTION
|
||||
Adds \fIcount\fP columns of the given \fItype\fP at the specified
|
||||
\fIposition\fP. See the XmLGrid man page for an explaination of column
|
||||
types. A position of 0 indicates the first column
|
||||
of the given type. A position of -1 specifies after the last
|
||||
position of that column type. The Grid will call its XmNaddCallback
|
||||
callbacks for each column and cell it creates. It will remain
|
||||
scrolled to the column scrolled to prior to the addition of
|
||||
columns, and focus will remain in the column which had focus
|
||||
prior to the addition of the columns.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridAddRows(3X)
|
||||
@@ -1,61 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridAddRows 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridAddRows \- add rows to a Grid
|
||||
.SH SYNTAX
|
||||
void XmLGridAddRows(\fIwidget\fP, \fItype\fP, \
|
||||
\fIposition\fP, \fIcount\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.br
|
||||
int \fIposition\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of row
|
||||
.IP \fIposition\fP 1i
|
||||
position of first row
|
||||
.IP \fIcount\fP 1i
|
||||
number of rows to add
|
||||
.SH DESCRIPTION
|
||||
Adds \fIcount\fP rows of the given \fItype\fP at the specified
|
||||
\fIposition\fP. See the XmLGrid man page for an explaination of row
|
||||
types. A position of 0 indicates the first row
|
||||
of the given type. A position of -1 specifies after the last
|
||||
position of that row type. The Grid will call its XmNaddCallback
|
||||
callbacks for each row and cell it creates. It will remain
|
||||
scrolled to the row scrolled to prior to the addition of
|
||||
rows, and focus will remain in the row which had focus
|
||||
prior to the addition of the rows.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridAddColumns(3X)
|
||||
@@ -1,47 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridColumnIsVisible 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridColumnIsVisible \- determine visiblily of a content column
|
||||
.SH SYNTAX
|
||||
void XmLGridColumnIsVisible(\fIwidget\fP, \fIcolumn\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
int \fIcolumn\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fIcolumn\fP 1i
|
||||
position of content column
|
||||
.SH DESCRIPTION
|
||||
Determines visibility of a content column.
|
||||
.SH RETURN VALUE
|
||||
Returns True if any part of the content column given is visible
|
||||
to the user, and False otherwise.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridRowIsVisible(3X)
|
||||
@@ -1,78 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridCopyPos 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridCopyPos \- copy the string contents of cells in a Grid at a
|
||||
given location to the clipboard
|
||||
.SH SYNTAX
|
||||
Boolean XmLGridCopyPos(\fIwidget\fP, \fItime\fP, \fIrowType\fP, \fIrow\fP, \
|
||||
\fIcolumnType\fP, \fIcolumn\fP, \fInrow\fP, \fIncolumn\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
Time \fItime\fP;
|
||||
.br
|
||||
unsigned char \fIrowType\fP;
|
||||
.br
|
||||
int \fIrow\fP;
|
||||
.br
|
||||
unsigned char \fIcolumnType\fP;
|
||||
.br
|
||||
int \fIcolumn\fP;
|
||||
.br
|
||||
int \fInrow\fP;
|
||||
.br
|
||||
int \fIncolumn\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItime\fP 1i
|
||||
Time of event
|
||||
.IP \fIrowType\fP 1i
|
||||
type of first row
|
||||
.IP \fIrow\fP 1i
|
||||
location of first row
|
||||
.IP \fIcolumnType\fP 1i
|
||||
type of first column
|
||||
.IP \fIcolumn\fP 1i
|
||||
location of first column
|
||||
.IP \fInrow\fP 1i
|
||||
number of rows
|
||||
.IP \fIncolumn\fP 1i
|
||||
number of columns
|
||||
.SH DESCRIPTION
|
||||
Copies the contents of cells in \fInrow\fP number of rows and
|
||||
\fIncolumn\fP number of columns to the clipboard
|
||||
starting at the row and column specified by
|
||||
\fIrowType\fP, \fIrow\fP, \fIcolumnType\fP, and \fIcolumn\fP.
|
||||
The \fItime\fP parameter should be set to the time of the event
|
||||
(most likely CurrentTime).
|
||||
.SH RETURN VALUE
|
||||
A value of True is returned upon success, and False is returned
|
||||
upon failure.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridCopySelected(3X) XmLGridPaste(3X)
|
||||
@@ -1,49 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridCopySelected 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridCopySelected \- copy the string contents of selected cells in a Grid
|
||||
to the clipboard
|
||||
.SH SYNTAX
|
||||
Boolean XmLGridCopySelected(\fIwidget\fP, \fItime\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
Time \fItime\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItime\fP 1i
|
||||
Time of event
|
||||
.SH DESCRIPTION
|
||||
Copies the contents any selected cells in a Grid to the clipboard.
|
||||
The \fItime\fP parameter should be set to the time of the event
|
||||
(most likely CurrentTime).
|
||||
.SH RETURN VALUE
|
||||
True is returned upon success, and False is returned upon failure.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridCopyPos(3X) XmLGridPaste(3X)
|
||||
@@ -1,53 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeleteAllColumns 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeleteAllColumns \- delete all columns of a given type
|
||||
.SH SYNTAX
|
||||
void XmLGridDeleteAllColumns(\fIwidget\fP, \fItype\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of column
|
||||
.SH DESCRIPTION
|
||||
Deletes all columns of the given type. The Grid will call its
|
||||
XmNdeleteCallback callbacks for each column and cell deleted.
|
||||
If possible, the focus will remain in the column which had focus
|
||||
prior to the deletion of columns. If the cell which has focus
|
||||
is in one of the columns deleted, the Grid's XmNcellFocusCallback
|
||||
callbacks will be called with a reason of XmCR_CELL_FOCUS_OUT before
|
||||
that column is deleted. If a cell in one of the columns is
|
||||
currently being edited, the Grid's XmNeditCallback callbacks
|
||||
will be called with a reason of XmCR_EDIT_CANCEL before that
|
||||
column is deleted.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridDeleteColumns(3X) XmLGridDeleteAllRows(3X)
|
||||
@@ -1,53 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeleteAllRows 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeleteAllRows \- delete all rows of a given type
|
||||
.SH SYNTAX
|
||||
void XmLGridDeleteAllRows(\fIwidget\fP, \fItype\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of row
|
||||
.SH DESCRIPTION
|
||||
Deletes all rows of the given type. The Grid will call its
|
||||
XmNdeleteCallback callbacks for each row and cell deleted.
|
||||
If possible, the focus will remain in the row which had focus
|
||||
prior to the deletion of rows. If the cell which has focus
|
||||
is in one of the rows deleted, the Grid's XmNcellFocusCallback
|
||||
callbacks will be called with a reason of XmCR_CELL_FOCUS_OUT before
|
||||
that row is deleted. If a cell in one of the rows is
|
||||
currently being edited, the Grid's XmNeditCallback callbacks
|
||||
will be called with a reason of XmCR_EDIT_CANCEL before that
|
||||
row is deleted.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridDeleteRows(3X) XmLGridDeleteAllColumns(3X)
|
||||
@@ -1,64 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeleteColumns 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeleteColumns \- delete columns in a Grid
|
||||
.SH SYNTAX
|
||||
void XmLGridDeleteColumns(\fIwidget\fP, \fItype\fP, \
|
||||
\fIposition\fP, \fIcount\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.br
|
||||
int \fIposition\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of column
|
||||
.IP \fIposition\fP 1i
|
||||
position of first column
|
||||
.IP \fIcount\fP 1i
|
||||
number of columns to delete
|
||||
.SH DESCRIPTION
|
||||
Deletes \fIcount\fP columns of the given \fItype\fP in the Grid at
|
||||
the specified \fIposition\fP. A position of 0 indicates the
|
||||
first column of the given type. The Grid will call its
|
||||
XmNdeleteCallback callbacks for each column and cell deleted.
|
||||
If possible, the focus will remain in the column which had
|
||||
focus prior to the deletion of columns. If the cell which has
|
||||
focus is in one of the columns deleted, the Grid's
|
||||
XmNcellFocusCallback callbacks will be called with a reason of
|
||||
XmCR_CELL_FOCUS_OUT before that column is deleted.
|
||||
If a cell in one of the columns is currently being edited,
|
||||
the Grid's XmNeditCallback callbacks will be called with a
|
||||
reason of XmCR_EDIT_CANCEL before that column is deleted.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridDeleteRows(3X)
|
||||
@@ -1,64 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeleteRows 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeleteRows \- delete rows in a Grid
|
||||
.SH SYNTAX
|
||||
void XmLGridDeleteRows(\fIwidget\fP, \fItype\fP, \
|
||||
\fIposition\fP, \fIcount\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
unsigned char \fItype\fP;
|
||||
.br
|
||||
int \fIposition\fP;
|
||||
.br
|
||||
int \fIcount\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fItype\fP 1i
|
||||
type of row
|
||||
.IP \fIposition\fP 1i
|
||||
position of first row
|
||||
.IP \fIcount\fP 1i
|
||||
number of rows to delete
|
||||
.SH DESCRIPTION
|
||||
Deletes \fIcount\fP rows of the given \fItype\fP in the Grid at
|
||||
the specified \fIposition\fP. A position of 0 indicates the
|
||||
first row of the given type. The Grid will call its
|
||||
XmNdeleteCallback callbacks for each row and cell deleted.
|
||||
If possible, the focus will remain in the row which had
|
||||
focus prior to the deletion of rows. If the cell which has
|
||||
focus is in one of the rows deleted, the Grid's
|
||||
XmNcellFocusCallback callbacks will be called with a reason of
|
||||
XmCR_CELL_FOCUS_OUT before that row is deleted.
|
||||
If a cell in one of the rows is currently being edited,
|
||||
the Grid's XmNeditCallback callbacks will be called with a
|
||||
reason of XmCR_EDIT_CANCEL before that row is deleted.
|
||||
.SH "SEE ALSO"
|
||||
XmLGrid(3X) XmLGridDeleteColumns(3X)
|
||||
@@ -1,46 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeselectAllCells 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeselectAllCells \- deselect all content cells
|
||||
.SH SYNTAX
|
||||
void XmLGridDeselectAllCells(\fIwidget\fP, \fInotify\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
Boolean \fInotify\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fInotify\fP 1i
|
||||
if True, deselect callbacks will be called
|
||||
.SH DESCRIPTION
|
||||
Deselects all content cells in the Grid. If \fInotify\fP is True,
|
||||
the Grid's XmNdeselectCallback callbacks will be called for
|
||||
each cell deselected.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridDeselectAllRows(3X) XmLGridDeselectAllColumns(3X)
|
||||
@@ -1,46 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeselectAllColumns 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeselectAllColumns \- deselect all content columns
|
||||
.SH SYNTAX
|
||||
void XmLGridDeselectAllColumns(\fIwidget\fP, \fInotify\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
Boolean \fInotify\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fInotify\fP 1i
|
||||
if True, deselect callbacks will be called
|
||||
.SH DESCRIPTION
|
||||
Deselects all content columns in the Grid. If \fInotify\fP is True,
|
||||
the Grid's XmNdeselectCallback callbacks will be called for
|
||||
each column deselected.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridDeselectAllCells(3X) XmLGridDeselectAllRows(3X)
|
||||
@@ -1,46 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeselectAllRows 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeselectAllRows \- deselect all content rows
|
||||
.SH SYNTAX
|
||||
void XmLGridDeselectAllRows(\fIwidget\fP, \fInotify\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
Boolean \fInotify\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fInotify\fP 1i
|
||||
if True, deselect callbacks will be called
|
||||
.SH DESCRIPTION
|
||||
Deselects all content rows in the Grid. If \fInotify\fP is True,
|
||||
the Grid's XmNdeselectCallback callbacks will be called for
|
||||
each row deselected.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridDeselectAllCells(3X) XmLGridDeselectAllColumns(3X)
|
||||
@@ -1,57 +0,0 @@
|
||||
.\" The contents of this file are subject to the Netscape Public License
|
||||
.\" Version 1.0 (the "NPL"); you may not use this file except in
|
||||
.\" compliance with the NPL. You may obtain a copy of the NPL at
|
||||
.\" http://www.mozilla.org/NPL/
|
||||
.\"
|
||||
.\" Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
.\" WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
.\" for the specific language governing rights and limitations under the
|
||||
.\" NPL.
|
||||
.\"
|
||||
.\" The Initial Developer of this code under the NPL is Netscape
|
||||
.\" Communications Corporation. Portions created by Netscape are
|
||||
.\" Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
.\" Reserved.
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\"
|
||||
.\" The following source code is part of the Microline Widget Library.
|
||||
.\" The Microline widget library is made available to Mozilla developers
|
||||
.\" under the Netscape Public License (NPL) by Neuron Data. To learn
|
||||
.\" more about Neuron Data, please visit the Neuron Data Home Page at
|
||||
.\" http://www.neurondata.com.
|
||||
.\"
|
||||
.\"
|
||||
.TH XmLGridDeselectCell 3X "R1" "XML1" "XML"
|
||||
.SH NAME
|
||||
XmLGridDeselectCell \- deselect a cell
|
||||
.SH SYNTAX
|
||||
void XmLGridDeselectCell(\fIwidget\fP, \fIrow\fP, \
|
||||
\fIcolumn\fP, \fInotify\fP)
|
||||
.br
|
||||
Widget \fIwidget\fP;
|
||||
.br
|
||||
int \fIrow\fP;
|
||||
.br
|
||||
int \fIcolumn\fP;
|
||||
.br
|
||||
Boolean \fInotify\fP;
|
||||
.LP
|
||||
.SH ARGUMENTS
|
||||
.IP \fIwidget\fP 1i
|
||||
Grid widget ID
|
||||
.IP \fIrow\fP 1i
|
||||
position of content row
|
||||
.IP \fIcolumn\fP 1i
|
||||
position of content column
|
||||
.IP \fInotify\fP 1i
|
||||
if True, deselect callbacks will be called
|
||||
.SH DESCRIPTION
|
||||
Deselects the cell in the Grid at the content \fIrow\fP and
|
||||
content \fIcolumn\fP specified. If \fInotify\fP is True
|
||||
and the cell is currently selected, the Grid's XmNdeselectCallback
|
||||
callbacks will be called.
|
||||
.SH "SEE ALSO"
|
||||
XmLGridDeselectAllCells(3X) XmLGridDeselectRow(3X)
|
||||
XmLGridDeselectColumn(3X)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user