home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
p2demo21.exe
/
PEL
/
ASCII.PEL
next >
Wrap
Text File
|
1995-04-04
|
3KB
|
108 lines
# $Header: P:\source\wmacros\ascii.pev 1.7 04 Apr 1995 09:27:14 WALKER $
##############################################################################
#
##
## Compuware Corporation
## 31440 Northwestern Highway
## Farmington Hills, Michigan 48334-2564
##
## This source code listing contains information that is
## proprietary to Compuware Corporation and may not be copied
## duplicated, translated, transmitted, stored, retrieved
## or in any manner or by any method conveyed or disclosed
## to a third party or parties without express written
## permission from Compuware Corporation.
##
#
##############################################################################
#### $Workfile: ascii.pel $ Ascii Table
local HEX_TEXT = 104
local DEC_TEXT = 105
global function display_ascii_table()
{
local X_EXTENT = 16
local Y_EXTENT = 16
local i
local j
local hdlg
if (isWindows() && length(search_path("charmap.exe", "PATH")))
system("charmap.exe") # Windows's charmap is cool!
else
{
message( "Creating Ascii Table..." )
hdlg = create_mdialog(function_id("ascii_dialog_callback"), -1, 1800, resource_dll );
for ( i = 1; i <= Y_EXTENT; i++ )
{
for ( j = 1; j <= X_EXTENT; j++ )
{
set_dialog_item( hdlg, 101, DAC_VS_SET_ITEM, i, j, chr( (i-1) * Y_EXTENT + (j-1) ));
}
}
set_dialog_item( hdlg, HEX_TEXT, DAC_TEXT, "0" )
set_dialog_item( hdlg, DEC_TEXT, DAC_TEXT, "0" )
begin_dialog( hdlg, TRUE )
message( "" )
}
}
global function ascii_dialog_callback()
{
local ret_val = DRC_CONTINUE
local val, row, col
if ( callback_msg == DM_VS_SELECT )
{
row = and(callback_data, 0xFFFF)
col = and(shiftr(callback_data, 16) , 0xFFFF )
val = (row-1) * 16 + (col-1)
set_dialog_item( callback_dialog_handle, HEX_TEXT, DAC_TEXT,
sprintf( "%X", val) )
set_dialog_item( callback_dialog_handle, DEC_TEXT, DAC_TEXT,
sprintf( "%d", val) )
ret_val = DRC_MSG_PROCESSED
}
else if (callback_dialog_handle == regex_dlg && callback_msg == DM_CLOSE)
regex_dlg = 0
return ret_val
}
#
# Regular Expression Table
#
local IDD_REGEX_TABLE = 1600
local regex_dlg
global function display_regex_table()
{
regex_dlg = create_mdialog( function_id("ascii_dialog_callback"),
prompt_display_handle ? prompt_display_handle : -1,
IDD_REGEX_TABLE, resource_dll )
begin_dialog(regex_dlg, TRUE)
}
global function delete_regex_table()
{
if (regex_dlg)
{
delete_dialog(regex_dlg)
regex_dlg = 0
}
}