home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 November
/
VPR0111A.ISO
/
HSTRAIAL
/
MSHagaki
/
MM3.Cab
/
F96809_mshslabl.vs.4722E93C_9B97_42FF_8575_C46D868BB8C1
< prev
next >
Wrap
Text File
|
2001-07-04
|
13KB
|
400 lines
////////////////////////////////////////////////////////////////////////////////////
// ”宛名ラベル”、”名刺”、”プリントシール”、”AVラベル”共通
////////////////////////////////////////////////////////////////////////////////////
// *****************************************************************************************************
// * 重要 xxxxxxx_onChange Sub プロシージャは、ComboBox の Select 監視を行っています。
// *****************************************************************************************************
// ラベルの会社名の選択を監視
Sub label_company_onChange()
Dim nSelectedModel, nSelectedCompany
nSelectedModel = 0
nSelectedCompany = get_selected_company()
Call parent.window.external.push_selectindex( nSelectedModel, nSelectedCompany )
Call window.navigate( window.location )
End Sub
// ラベルの型番名の選択を監視
Sub label_model_onChange()
Dim nSelectedModel, nSelectedCompany
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
Call parent.window.external.push_selectindex( nSelectedModel, nSelectedCompany )
Call window.navigate( window.location )
End Sub
// *****************************************************************************************************
// 指定された識別名で Cookie に値を保存する
Sub SetCookieVariable( strVariableName, varVariableValue )
Document.Cookie = strVariableName & "=" & varVariableValue
End Sub
// 保存されている Cookie の抽出
Function ReadCookieVariable( strVariableName )
Dim intLocation
Dim intNameLength
Dim intValueLength
Dim intNextSemicolon
Dim strTemp
Dim tempValue
intNameLength = Len( strVariableName )
intLocation = Instr( Document.Cookie, strVariableName)
If intLocation = 0 Then
ReadCookieVariable = NOT_FOUND
tempValue = NOT_FOUND
Else
strTemp = Right(Document.Cookie, Len(Document.Cookie) - intLocation + 1)
If Mid(strTemp, intNameLength + 1, 1) <> "=" Then
ReadCookieVariable = NOT_FOUND
tempValue = NOT_FOUND
Else
intNextSemicolon = Instr( strTemp, ";" )
If intNextSemicolon = 0 Then intNextSemicolon = Len(strTemp) + 1
If intNextSemicolon = (intNameLength + 2) Then
ReadCookieVariable = ""
tempValue = ""
Else
intValueLength = intNextSemicolon - intNameLength - 2
ReadCookieVariable = Mid( strTemp, intNameLength + 2, intValueLength )
tempValue = Mid( strTemp, intNameLength + 2, intValueLength )
End If
End If
End if
End Function
// 垂直スクロールバーの非表示
Function hidden_vertical_scrollbar()
End Function
// 選択されているラベルの会社名の抽出
Function get_selected_company()
get_selected_company = document.formcompany.label_company.selectedindex
End Function
// 選択されているラベルの型番名の抽出
Function get_selected_model()
get_selected_model = document.formmodel.label_model.selectedindex
End Function
// ラベルに対する会社名、および、ラベル型番名を初期化し、LABEL-DB の recordset からの検索を可能にする
// ※必ず、update_descriptions() 関数を呼び出す前に、この関数を先に呼び出すこと
Function refresh_label_company_model_index()
Dim nCategoryIindex, szCategoryNow
// 保存されている選択カテゴリーの抽出
szCategoryNow = ReadCookieVariable( "HSCATEGORYNAME" )
// 保存されていた選択カテゴリーを設定
Call parent.window.external.set_curcategory( szCategoryNow )
End Function
// 選択されているカテゴリー値の抽出
Function get_current_category_index()
Dim nCategoryIindex, szCategoryNow
Call hidden_vertical_scrollbar()
// 保存されている選択カテゴリーの抽出
szCategoryNow = ReadCookieVariable( "HSCATEGORYNAME" )
Select Case (szCategoryNow)
Case "Hagaki"
nCategoryIindex = 1
Case "Envelope"
nCategoryIindex = 2
Case "Address"
nCategoryIindex = 3
Case "Card"
nCategoryIindex = 4
Case "Print"
nCategoryIindex = 5
Case "AV"
nCategoryIindex = 6
Case "DesignOpen"
nCategoryIindex = 7
Case "AddressBook"
nCategoryIindex = 8
Case Else
nCategoryIindex = 0
End Select
get_current_category_index = nCategoryIindex
End Function
// ラベルに対する会社名を選択できるようにする
Function set_label_company()
Dim nCategoryIindex, nCount, fIsSelect, szCompanyName
nCategoryIindex = get_current_category_index()
nCount = parent.window.external.get_companycount( nCategoryIindex )
If nCount > 0 Then
For i = 0 To (nCount-1) Step 1
Call parent.window.external.enum_companyname( fIsSelect, szCompanyName, i, nCategoryIindex )
If fIsSelect <> 0 Then
Call document.write( "<option value='" & szCompanyName & "' selected>" & szCompanyName & "</option>" )
Else
Call document.write( "<option value='" & szCompanyName & "'>" & szCompanyName & "</option>" )
End If
Next
End if
End Function
// ラベルに対する型番名を選択できるようにする
Function set_label_model( nCompanyIindex )
Dim nCategoryIindex, nCount, fIsSelect, szModelName, nSelectedModel
nCategoryIindex = get_current_category_index()
nCount = parent.window.external.get_modelcount( nCompanyIindex, nCategoryIindex )
nSelectedModel = 0
If nCount > 0 Then
For i = 0 To (nCount-1) Step 1
Call parent.window.external.enum_modelname( fIsSelect, szModelName, i, nCompanyIindex, nCategoryIindex )
If fIsSelect <> 0 Then
nSelectedModel = i
Call document.write( "<option value='" & szModelName & "' selected>" & szModelName & "</option>" )
Else
Call document.write( "<option value='" & szModelName & "'>" & szModelName & "</option>" )
End If
Next
End If
Call parent.window.external.update_descriptions( nSelectedModel, nCompanyIindex, nCategoryIindex )
End Function
// 指定されたタイプのラベルの横と縦の比を判定する
// return > 0 : 横 > 縦
// return = 0 : 横 = 縦
// return < 0 : 横 < 縦
Function check_label_aspect_ratio()
Dim szWidth, szHeight, szGetType1, szGetType2
Dim nCategoryIindex, nSelectedModel, nSelectedCompany
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
szGetType1 = "paperwidth"
szGetType2 = "paperheight"
Call parent.window.external.get_description(szWidth, szGetType1, nSelectedModel, nCompanyInedex, nCategoryIindex)
Call parent.window.external.get_description(szHeight, szGetType2, nSelectedModel, nCompanyInedex, nCategoryIindex)
If szWidth > szHeight Then
check_label_aspect_ratio = 1
End If
If szWidth = szHeight Then
check_label_aspect_ratio = 0
End If
If szWidth < szHeight Then
check_label_aspect_ratio = -1
End If
End Function
// 選択されたラベル型番のイメージを表示する
Function set_label_image()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany, szImageFileName, nWidth, nHeight, nAspectRatio
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
nAspectRatio = check_label_aspect_ratio()
If nAspectRatio > 0 Then
nWidth = 125
nHeight = 86
End If
If nAspectRatio = 0 Then
nWidth = 125
nHeight = 125
End If
If nAspectRatio < 0 Then
nWidth = 86
nHeight = 125
End If
Call parent.window.external.get_bmpfilename( szImageFileName, nHeight, nWidth, nSelectedModel, nSelectedCompany, nCategoryIindex )
Call document.write( "<img src=" & szImageFileName & "width='" & nWidth & "' height='" & nHeight & "'>" )
End Function
Function set_label_image_small()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany, szImageFileName, nWidth, nHeight
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
nAspectRatio = check_label_aspect_ratio()
If nAspectRatio > 0 Then
nWidth = 110
nHeight = 76
End If
If nAspectRatio = 0 Then
nWidth = 110
nHeight = 110
End If
If nAspectRatio < 0 Then
nWidth = 76
nHeight = 110
End If
Call parent.window.external.get_bmpfilename( szImageFileName, nHeight, nWidth, nSelectedModel, nSelectedCompany, nCategoryIindex )
Call document.write( "<img src=" & szImageFileName & "width='" & nWidth & "' height='" & nHeight & "'>" )
End Function
// 指定されたタイプのラベル説明文を抽出する
Function get_string_label_description( nGetTypeIndex, nCategoryIindex, nCompanyInedex, nModelIndex )
Dim szDescription, szInfo1, szInfo2, szGetType1, szGetType2, szCaption, szMark
szDescription = ""
szInfo1 = ""
szInfo2 = ""
szGetType1 = ""
szGetType2 = ""
szCaption = ""
szMark = ""
Select Case (nGetTypeIndex)
Case 1 '''' 説明1
szGetType1 = "discription1"
Case 2 '''' 説明2
szGetType1 = "discription2"
Case 3 '''' 用途
szCaption = "用途 : "
szGetType1 = "paperpurpose"
Case 4 '''' 紙質
szCaption = "紙質 : "
szGetType1 = "papertype"
Case 5 '''' 用紙サイズ(幅 x 高さ)
szCaption = "用紙 : "
szMark = " * "
szGetType1 = "paperwidth"
szGetType2 = "paperheight"
Case 6 '''' ラベルサイズ(幅 x 高さ)
szCaption = "ラベル : "
szMark = " * "
szGetType1 = "stickerwidth"
szGetType2 = "stickerheight"
Case 7 '''' 左マージン
szCaption = "左マージン : "
szGetType1 = "leftmargin"
Case 8 '''' 上マージン
szCaption = "上マージン : "
szGetType1 = "topmargin"
Case Else
End Select
If szGetType1 <> "" Then
Call parent.window.external.get_description(szInfo1, szGetType1, nModelIndex, nCompanyInedex, nCategoryIindex)
End if
If szGetType2 <> "" Then
Call parent.window.external.get_description(szInfo2, szGetType2, nModelIndex, nCompanyInedex, nCategoryIindex)
End if
get_string_label_description = szCaption & szInfo1 & szMark & szInfo2
End Function
// 選択されたラベル型番の説明文を表示する
Function set_label_description()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany, szDescription
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
For i = 1 To 8 Step 1
szDescription = get_string_label_description( i, nCategoryIindex, nSelectedCompany, nSelectedModel )
If i = 5 Then
Call document.write( "サイズ(単位 : mm)<br>" )
End If
If i >= 5 And i <= 8 Then
Call document.write( " " )
End If
Call document.write( szDescription & "<br>" )
Next
End Function
Function set_label_description_only()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany, szDescription
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
For i = 1 To 2 Step 1
szDescription = get_string_label_description( i, nCategoryIindex, nSelectedCompany, nSelectedModel )
Call document.write( szDescription & "<br>" )
Next
End Function
Function set_label_description_info()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany, szDescription
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
For i = 3 To 8 Step 1
szDescription = get_string_label_description( i, nCategoryIindex, nSelectedCompany, nSelectedModel )
If i = 5 Then
Call document.write( "サイズ(単位 : mm)<br>" )
End If
If i >= 5 And i <= 8 Then
Call document.write( " " )
End If
Call document.write( szDescription & "<br>" )
Next
End Function
// 選択されたラベル型番名を DLL 側に記憶させる
Function set_label_model_index()
Dim nSelectedModel, nSelectedCompany
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
Call parent.window.external.push_selectindex( nSelectedModel, nSelectedCompany )
End Function
// 選択されたラベル型番名を入力BOXに表示し、DLL 側にラベル型番名を記憶させる
Function set_label_modelname()
Dim szLabelModelName
Call parent.window.external.get_labelmodelname( szLabelModelName )
Call document.write( "<input type= 'text' name= 'textfield' value=" & szLabelModelName & "size='32' maxlength='32'>" )
Call set_label_model_index()
End Function
// 選択されたラベル型番名を入力BOXに表示する
Function disp_label_modelname()
Dim szLabelModelName
Call parent.window.external.get_labelmodelname( szLabelModelName )
Call document.write( "<input type= 'text' name= 'textfield' value=" & szLabelModelName & "size='32' maxlength='32'>" )
End Function
// 選択されたラベル型番名のインフォメーションデーターを DLL のバッファーに作成/更新する
Function create_label_info_data()
Dim nCategoryIindex, nSelectedModel, nSelectedCompany
nCategoryIindex = get_current_category_index()
nSelectedModel = get_selected_model()
nSelectedCompany = get_selected_company()
Call parent.window.external.update_descriptions( nSelectedModel, nSelectedCompany, nCategoryIindex )
End Function