OSDN Git Service

Ring 1.10 以来となる開発環境の日本語ローカライズ版 (評価版) を追加 (ノートパッド、フォームデザイナー、対話型実行環境、ファイルの検索)。
[ring-lang-081/ring.git] / applications / build / ja-jp / formdesigner / controls / qimage.ring
1 /*
2 **      Project : Form Designer 
3 **      File Purpose :  QImage Control
4 **      Date : 2017.04.29
5 **      Author :  Mahmoud Fayed <msfclipper@yahoo.com>
6 */
7
8 package formdesigner
9
10 class FormDesigner_QImage from QLabel
11
12         CreateCommonAttributes()
13         CreateMoveResizeCornersAttributes()
14
15         cImageFile = ""
16
17         func SetImageFile cValue
18                 cImageFile = cValue
19
20         func ImageFile
21                 return cImageFile
22
23         func AddObjectProperties  oDesigner
24                 AddObjectCommonProperties(oDesigner)
25                 oDesigner.oView.AddProperty(T_FORMDESIGNER_ATTRIBUTE_IMAGEFILE,True)    # "Image File"
26
27         func DisplayProperties oDesigner
28                 DisplayCommonProperties(oDesigner)
29                 oPropertiesTable = oDesigner.oView.oPropertiesTable
30                 oPropertiesTable.Blocksignals(True)
31                 # Set the Image File
32                         oPropertiesTable.item(C_AFTERCOMMON,1).settext(ImageFile())
33                         DisplayTheImage(oDesigner)
34                 oPropertiesTable.Blocksignals(False)
35                 # Set the object name
36                         if cImageFile = NULL {
37                                 setText(oDesigner.oModel.GetObjectName(self))
38                         }
39
40         func UpdateProperties oDesigner,nRow,nCol,cValue
41                 UpdateCommonProperties(oDesigner,nRow,nCol,cValue)
42                 if nRow = C_AFTERCOMMON {
43                         setImageFile(cValue)
44                         DisplayTheImage(oDesigner)
45                 }
46                 # Set the object name
47                         if cImageFile = NULL {
48                                 setText(oDesigner.oModel.GetObjectName(self))
49                         }
50
51         func DisplayTheImage oDesigner
52                 if fexists(ImageFile()) {
53                         setpixmap(new qpixmap(ImageFile()))     
54                 else 
55                         cFileAndPath = JustFilePath(oDesigner.oFile.GetFileName())+ImageFile()                          
56                         setpixmap(new qpixmap(cFileAndPath))
57                 }
58
59         func ObjectDataAsString oDesigner,nTabsCount
60                 cOutput = ObjectDataAsString2(oDesigner,nTabsCount)
61                 cTabs = std_copy(char(9),nTabsCount)
62                 cOutput += "," + nl + cTabs + ' :imagefile =  "' + oDesigner.PrepareStringForFormFile(ImageFile()) + '"'
63                 return cOutput
64
65         func RestoreProperties oDesigner,Item
66                 RestoreCommonProperties(oDesigner,item)
67                 itemdata = item[:data]
68                 setImageFile(itemdata[:imagefile])
69                 DisplayProperties(oDesigner)
70
71         func GenerateCustomCode oDesigner
72                 cOutput = ""
73                 cOutput += 'setPixMap(New qPixMap("#{f1}"))' + nl
74                 cOutput = substr(cOutput,"#{f1}",oDesigner.PrepareStringForFormFile(ImageFile()))
75                 return cOutput
76
77         func DialogButtonAction oDesigner,nRow
78                 CommonDialogButtonAction(oDesigner,nRow)
79                 if nRow = C_AFTERCOMMON {       # Image File
80                         cFile = oDesigner.oGeneral.SelectFile(oDesigner)
81                         # Use Relative Path
82                                 cFormPath = JustFilePath(oDesigner.oFile.GetFileName())+ImageFile()                             
83                                 if len(cFile) > len(cFormPath) {
84                                         if left(cFile,len(cFormPath)) = cFormPath {
85                                                 cFile = substr(cFile,len(cFormPath)+1)
86                                         }
87                                 } 
88                         setImageFile(cFile)
89                         DisplayProperties(oDesigner)
90                 }
91