home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
corel
/
Scripts
/
imagevw.csc
< prev
next >
Wrap
Text File
|
1998-02-06
|
2KB
|
68 lines
rem Zobrazφ rastry v poli s m∞nitel. velik.
rem ImageVw.csc 29.Φervence 1996
rem Copyright 1998 Corel Corporation. VÜechna prßva vyhrazena.
REM ***************************************************************
REM * Global Data *
REM ***************************************************************
#include "ScpConst.csi"
REM ***************************************************************
REM * Main Dialog *
REM ***************************************************************
BEGIN DIALOG OBJECT MainDialog 200, 100, "Corel SCRIPT Image Viewer", SUB MainDialogSub
TEXT 5, 6, 120, 10, .Filename, ""
IMAGE 5, 25, 190, 70, .ImageView
PUSHBUTTON 135, 5, 60, 14, .Browse, "Browse"
END DIALOG
'Initialize the styles for the controls
MainDialog.SetStyle STYLE_MINIMZERESIZE
MainDialog.FileName.SetStyle STYLE_SUNKEN
MainDialog.ImageView.SetStyle STYLE_SUNKEN
'Execute the dialog
DIALOG MainDialog
REM ***************************************************************
REM * MainDialogSub: handles both the Browse button and the *
REM * dialog resizing. *
REM ***************************************************************
SUB MainDialogSub(BYVAL ControlID%, BYVAL Event%)
DIM FileName AS STRING
DIM DialogWidth AS INTEGER
DIM DialogHeight AS INTEGER
DIM ImageHeight AS INTEGER
DIM ImageWidth AS INTEGER
WITH MainDialog
IF Event% = EVENT_MOUSE_CLICK THEN
'Only Browse button
FileName$ = GETFILEBOX("Bitmap files (*.bmp)|*.bmp")
IF FileName$ <> "" THEN
.FileName.SetText FileName$
.ImageView.SetImage FileName$
ENDIF
ENDIF
IF Event% = 6 THEN
'Make sure the dialog has a reasonable size
DialogWidth% = .GetWidth()
IF DialogWidth% < 100 THEN DialogWidth% = 100
DialogHeight% = .GetHeight()
IF DialogHeight% < 60 THEN DialogHeight% = 60
.Move .GetLeftPosition(), .GetTopPosition(), DialogWidth%, DialogHeight%
'Resize the image
ImageHeight% = DialogHeight% - 30
ImageWidth% = DialogWidth% - 10
.ImageView.Move 5,25,ImageWidth%, ImageHeight%
'Resize the file name
.FileName.Move 5, 6, DialogWidth% - 80, 10
'Reposition the move button
.Browse.Move DialogWidth% - 65, 5
ENDIF
END WITH
END SUB