home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
ICONDEM2.PRG
< prev
next >
Wrap
Text File
|
1995-06-27
|
2KB
|
73 lines
// IconDem2.prg - Icon Demo (non-OO)
//
// Written by: John M. Skelton, Mar-95.
//
// Copyright (C) 1995 Skelton Software, Kendal Cottage, Hillam, Leeds LS25 5HP, UK.
// All Rights Reserved.
//
// Part of Clip-4-Win.
#define WIN_WANT_ALL
#include "windows.ch"
#define NO_C4WCLASS
#include "commands.ch"
#include "icondemo.ch"
function main()
local oApp, oWnd
CREATE APPLICATION oApp WINDOW oWnd TITLE "Clip-4-Win Icon Demo" ;
ON INIT DemoDlg(oWnd)
return 0
static function DemoDlg(oWnd)
local oDlg
CREATE DIALOG oDlg RESOURCE "IconDemoDlg"
@ ID ID_MDIFRAME ICON IN oDlg
@ ID ID_SHOW BUTTON Show IN oDlg
@ ID ID_HIDE BUTTON Hide IN oDlg
@ ID ID_ADD BUTTON Add IN oDlg
SHOW DIALOG oDlg IN oWnd
PostQuitMessage(0)
return nil
static function Show(hDlg)
local aIcons := {ID_MDIFRAME, ID_MDICHILD, ID_MDIDLG}
aeval(aIcons, {|nId, h| iif((h := GetDlgItem(hDlg, nId)) == 0, , ;
ShowWindow(h, SW_SHOW))})
return nil
static function Hide(hDlg)
local aIcons := {ID_MDIFRAME, ID_MDICHILD, ID_MDIDLG}
aeval(aIcons, {|nId, h| iif((h := GetDlgItem(hDlg, nId)) == 0, , ;
ShowWindow(h, SW_HIDE))})
return nil
static function Add(hDlg)
local aId := {ID_MDIFRAME, ID_MDICHILD, ID_MDIDLG}, i, a
local aNames := {"MDIFRAME", "MDICHILD", "MDIDLG"}
for i = 1 to len(aNames)
if GetDlgItem(hDlg, aId[i]) == 0
// not there - create it
a = MapDialogRect(hDlg, {10, 40, 13, 13})
CreateWindow("static", aNames[i], CTL_DEFSTYLE + SS_ICON,;
a[1] * i * 2, a[2], a[3], a[4], hDlg, aId[i])
exit
endif
next i
return nil