WITH frmRename
.CAPTION = "Rename file"
.clientwidth = 200
.clientheight = 100
.center
.delbordericons 1, 2
.borderstyle = 1
.font = fntScreen
END WITH
WITH lblRename
.PARENT = frmRename
.left = 10: .top = 5
.CAPTION = "New file name:"
END WITH
WITH ediRename
.PARENT = frmRename
.left = 10: .top = 25: .width = 175
.charcase = 1
.font.COLOR = RGB(&H99, &H00, &H00)
.onKeyUp = ediRename_onKeyUp
END WITH
WITH btnRenameOK
.PARENT = frmRename
.left = 10: .top = 60: .width = 175: .height = 30
.onClick = btnRenameOK_OnClick
.CAPTION = "&OK"
.bmpHandle = bmp_ok
END WITH
WITH btnRenameCancel
.PARENT = frmRename
.width = 0
.kind = 2
END WITH
SUB ediRename_onKeyUp
IF LEN(ediRename.EditText) <= 4 THEN
btnRenameOK.Enabled = 0
ELSE: btnRenameOK.Enabled = 1
END IF
IF Key = 13 THEN setfocus (btnRenameOK.Handle)
END SUB
SUB btnRenameOK_OnClick
DIM temp AS BYTE
temp = MESSAGEBOX (frmRename.CAPTION + "?", Application.Title, 1)
IF temp <> 1 THEN EXIT SUB
IF (RIGHT$(ediRename.EditText, 4) = ".JPG" OR _
RIGHT$(ediRename.EditText, 4) = ".BMP") AND _
LEN(ediRename.EditText) > 4 THEN
frmRename.ModalResult = 1
ELSE
SELECT CASE cbxLang.Item(cbxLang.ItemIndex)
CASE "English": SHOWMESSAGE "Wrong file name. Please, check it."
CASE "Slovensky": SHOWMESSAGE "Nesprávny názov súboru. Prosím, skontrolujte ho."
END SELECT
END IF
END SUB
|