home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
p2demo21.exe
/
PEL
/
COLORS.PEL
< prev
next >
Wrap
Text File
|
1995-03-01
|
7KB
|
178 lines
# $Header: P:\source\wmacros\colors.pev 1.22 01 Mar 1995 15:39:18 PFHJXM0 $
##############################################################################
#
# 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: colors.pel $:
#
# colors for windows:
#
# These colors are made by ORing combinations of red, green and blue to
# form a long. Blue makes up the bottom 8 bits, Green the next 8, Red
# the following 8 and finally the top 8 are ZERO.
global COLOR_BLACK = 0x000000 # foreground or background
global COLOR_BLUE = 0x0000ff
global COLOR_GREEN = 0x00ff00
global COLOR_RED = 0xff0000
global COLOR_NEON_BABY_BLUE = 0x00FFFF
global COLOR_MAGENTA = 0xFF00FF
global COLOR_WHITE = 0xFFFFFF
global COLOR_MAROON = 0x6B238D
global COLOR_DARK_BLUE = 0x2A2AA5
global COLOR_BROWN = 0xA52A2A
global COLOR_ORCHID = 0xD760D7
global COLOR_PINK = 0xBC8E8E
global COLOR_MEDVIOLET = 0xB548B5
global COLOR_ORANGERED = 0xFF006E
global COLOR_DARKTURQUOIS = 0x6093D7
global COLOR_GREENYELLOW = 0x60D793
global COLOR_LTBLUE = 0x0088FF
global COLOR_YELLOW = 0xFFFF00
global COLOR_LTPURPLE = 0xD5B6FF
global COLOR_MDPURPLE = 0xFF80FF
global COLOR_DARK_GRAY = 0x404040
global COLOR_LIGHT_GRAY = 0xCCCCCC
global COLOR_MED_GRAY = 0x888888
global COLOR_GOLD = 0xBFA400
global COLOR_ORANGE = 0xFF7800
global COLOR_DARK_GREEN = 0x008C30
function ATTR_RED( color )
{
return and(color, COLOR_RED)
}
function ATTR_GREEN( color )
{
return and(color, COLOR_GREEN)
}
function ATTR_BLUE( color )
{
return and(color, COLOR_BLUE)
}
function reverseVideo()
{
local temp;
temp = color_window_fg
color_window_fg = color_window_bg
color_window_bg = temp
}
# DWM 4/7/94
# This function returns the config information to be saved for default colors
# in an array
global function color_config()
{
local data[]
local i = 1
data[ i++ ] = sprintf( "# Each pair is default FG followed by default BG. The order is as follows:\n" )
data[ i++ ] = sprintf( "# window, linenumbers, linecommands, message, notify, warning, error.\n" )
data[ i++ ] = sprintf( "0x%x\n", default_color_window_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_window_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_linenumbers_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_linenumbers_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_linecommands_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_linecommands_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_message_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_message_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_notify_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_notify_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_warning_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_warning_bg )
data[ i++ ] = sprintf( "0x%x\n", default_color_error_fg )
data[ i++ ] = sprintf( "0x%x\n", default_color_error_bg )
# data[ i++ ] = sprintf( "0x%x\n", default_color_bookmark_fg )
# data[ i++ ] = sprintf( "0x%x\n", default_color_bookmark_bg )
data[ i++ ] = sprintf( "\n" )
return data
}
# DWM
# This callback handles the two color dialog messages handled from pel:
# DM_OK, and DM_CLICK for the IDB_SAVE_CHANGES button
global function color_callback()
{
local curr_win = 0
local temp = ""
local rc = DRC_CONTINUE
if ( callback_msg == DM_OK )
{
if ( callback_data.apply_to_all )
{
# loop through the windows and reassign the colors
curr_win = current_window
while ( curr_win != next_window() )
{
color_window_bg = callback_data[ "color_window_bg" ]
color_window_fg = callback_data[ "color_window_fg" ]
color_linenumbers_bg = callback_data[ "color_linenumbers_bg" ]
color_linenumbers_fg = callback_data[ "color_linenumbers_fg" ]
color_linecommands_bg = callback_data[ "color_linecommands_bg" ]
color_linecommands_fg = callback_data[ "color_linecommands_fg" ]
update_current_view()
}
}
if ( callback_data.make_default )
{
# make these values the defaults
default_color_window_bg = callback_data[ "color_window_bg" ]
default_color_window_fg = callback_data[ "color_window_fg" ]
default_color_linenumbers_bg = callback_data[ "color_linenumbers_bg" ]
default_color_linenumbers_fg = callback_data[ "color_linenumbers_fg" ]
default_color_linecommands_bg = callback_data[ "color_linecommands_bg" ]
default_color_linecommands_fg = callback_data[ "color_linecommands_fg" ]
default_color_message_fg = callback_data[ "color_message_fg" ]
default_color_message_bg = callback_data[ "color_message_bg" ]
default_color_notify_fg = callback_data[ "color_notify_fg" ]
default_color_notify_bg = callback_data[ "color_notify_bg" ]
default_color_help_fg = callback_data[ "color_help_fg" ]
default_color_help_bg = callback_data[ "color_help_bg" ]
default_color_warning_fg = callback_data[ "color_warning_fg" ]
default_color_warning_bg = callback_data[ "color_warning_bg" ]
default_color_error_fg = callback_data[ "color_error_fg" ]
default_color_error_bg = callback_data[ "color_error_bg" ]
# default_color_bookmark_fg = callback_data[ "color_bookmark_fg" ]
# default_color_bookmark_bg = callback_data[ "color_bookmark_bg" ]
# update the config file
update_config_section( "$COLOR_SETTINGS$", color_config() )
}
}
return rc
}
global function color_dialog_key()
{
color_dialog( "color_callback", "colors" )
}