OpenOffice.org Basicでガントチャート
OpenOffice.org Basicを使ってガントチャート作成用マクロ ガントチャートforOOoを開発する手順を紹介していきます。
スポンサーサイト
上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。
プロパティ編集ダイアログ その2

次にリスナーおよび操作用変数を宣言し、初期化用のInitialize関数を作成します。

Private oActionListener As Object
Private oAdjustmentListener As Object
Private oMouseListener As Object

Private Id As Integer
Private flgUpdate As Boolean

アクションリスナーはボタンコントロール、アジャストメントリスナーはスクロールバー、マウスリスナーはイメージコントロール用に使用します。

前回宣言したコントロール用の変数と、上記リスナーを割り当てるInitialize関数は下記となります。

Sub Initialize
    
    oDialog = createUnoDialog(DialogLibraries.Standard.dlgEditProperty)
    'mdlText.MakeDialogModuleTemplete(oDialog, "dlgEditProperty")
    
    With oDialog
        txtSheetName = .getControl("txtSheetName")
        txtBeginDate = .getControl("txtBeginDate")
        cmbCellUnit = .getControl("cmbCellUnit")
        txtDrawRows = .getControl("txtDrawRows")
        scbChartBarWeight = .getControl("scbChartBarWeight")
        lblSheetName = .getControl("lblSheetName")
        lblBeginDate = .getControl("lblBeginDate")
        lblCellUnit = .getControl("lblCellUnit")
        lblDrawRows = .getControl("lblDrawRows")
        lblChartBarWeight = .getControl("lblChartBarWeight")
        lblChartBarPlanPos = .getControl("lblChartBarPlanPos")
        lblChartBarActPos = .getControl("lblChartBarActPos")
        lblChartBarType = .getControl("lblChartBarType")
        lblChartBarPlanLineColor = .getControl("lblChartBarPlanLineColor")
        lblChartBarPlanFillColor = .getControl("lblChartBarPlanFillColor")
        lblChartBarActLineColor = .getControl("lblChartBarActLineColor")
        lblChartBarActFillColor = .getControl("lblChartBarActFillColor")
        lblChartHolidayColor = .getControl("lblChartHolidayColor")
        scbChartBarPlanPos = .getControl("scbChartBarPlanPos")
        scbChartBarActPos = .getControl("scbChartBarActPos")
        cmbChartBarType = .getControl("cmbChartBarType")
        imgChartBarPlanLineColor = .getControl("imgChartBarPlanLineColor")
        imgChartBarPlanFillColor = .getControl("imgChartBarPlanFillColor")
        imgChartBarActLineColor = .getControl("imgChartBarActLineColor")
        imgChartBarActFillColor = .getControl("imgChartBarActFillColor")
        imgChartHolidayColor = .getControl("imgChartHolidayColor")
        lblProgressLineWeight = .getControl("lblProgressLineWeight")
        chkDrawProgressLine = .getControl("chkDrawProgressLine")
        scbProgressLineWeight = .getControl("scbProgressLineWeight")
        imgProgressLineColor = .getControl("imgProgressLineColor")
        lblMileStoneWeight = .getControl("lblMileStoneWeight")
        scbMileStoneWeight = .getControl("scbMileStoneWeight")
        chkPrintAllItems = .getControl("chkPrintAllItems")
        chkPrintNotCompleted = .getControl("chkPrintNotCompleted")
        chkInsertSpaceBetweenCategory = _
            .getControl("chkInsertSpaceBetweenCategory")
        btnOK = .getControl("btnOK")
        chkPrintLabel = .getControl("chkPrintLabel")
        chkCalculateStatus = .getControl("chkCalculateStatus")
        chkCalculateTimesWithoutHoliday = _
            .getControl("chkCalculateTimesWithoutHoliday")
        chkUseOptionalNote = .getControl("chkUseOptionalNote")
        txtChartBarWeight = .getControl("txtChartBarWeight")
        txtChartBarPlanPos = .getControl("txtChartBarPlanPos")
        txtChartBarActPos = .getControl("txtChartBarActPos")
        txtProgressLineWeight = .getControl("txtProgressLineWeight")
        txtMileStoneWeight = .getControl("txtMileStoneWeight")
        lblCategorizeType = .getControl("lblCategorizeType")
        lstCategorizeType = .getControl("lstCategorizeType")
    End With
    
    lblMileStoneWeight.setVisible(False)
    txtMileStoneWeight.setVisible(False)
    scbMileStoneWeight.setVisible(False)
    chkCalculateTimesWithoutHoliday.setVisible(False)
    chkUseOptionalNote.setVisible(False)
    
    oActionListener = _
        CreateUnoListener("dlgEditPropertyActionListener_", _
            "com.sun.star.awt.XActionListener")
    oAdjustmentListener = _
        CreateUnoListener("dlgEditPropertyAdjustmentListener_", _
            "com.sun.star.awt.XAdjustmentListener")
    oMouseListener = _
        CreateUnoListener("dlgEditPropertyMouseListener_", _
            "com.sun.star.awt.XMouseListener")
    
    btnOK.addActionListener(oActionListener)
    
    scbChartBarWeight.addAdjustmentListener(oAdjustmentListener)
    scbChartBarPlanPos.addAdjustmentListener(oAdjustmentListener)
    scbChartBarActPos.addAdjustmentListener(oAdjustmentListener)
    scbProgressLineWeight.addAdjustmentListener(oAdjustmentListener)
    scbMileStoneWeight.addAdjustmentListener(oAdjustmentListener)
    
    txtBeginDate.addMouseListener(oMouseListener)
    imgChartBarPlanLineColor.addMouseListener(oMouseListener)
    imgChartBarPlanFillColor.addMouseListener(oMouseListener)
    imgChartBarActLineColor.addMouseListener(oMouseListener)
    imgChartBarActFillColor.addMouseListener(oMouseListener)
    imgChartHolidayColor.addMouseListener(oMouseListener)
    imgProgressLineColor.addMouseListener(oMouseListener)

    lblSheetName.Text = dlgEditProperty_lblSheetName_Text
    lblBeginDate.Text = dlgEditProperty_lblBeginDate_Text
    lblCellUnit.Text = dlgEditProperty_lblCellUnit_Text
    lblDrawRows.Text = dlgEditProperty_lblDrawRows_Text
    lblChartBarWeight.Text = dlgEditProperty_lblChartBarWeight_Text
    lblChartBarPlanPos.Text = dlgEditProperty_lblChartBarPlanPos_Text
    lblChartBarActPos.Text = dlgEditProperty_lblChartBarActPos_Text
    lblChartBarType.Text = dlgEditProperty_lblChartBarType_Text
    lblChartBarPlanLineColor.Text = _
        dlgEditProperty_lblChartBarPlanLineColor_Text
    lblChartBarPlanFillColor.Text = _
        dlgEditProperty_lblChartBarPlanFillColor_Text
    lblChartBarActLineColor.Text = _
        dlgEditProperty_lblChartBarActLineColor_Text
    lblChartBarActFillColor.Text = _
        dlgEditProperty_lblChartBarActFillColor_Text
    lblChartHolidayColor.Text = dlgEditProperty_lblChartHolidayColor_Text
    lblProgressLineWeight.Text = dlgEditProperty_lblProgressLineWeight_Text
    lblMileStoneWeight.Text = dlgEditProperty_lblMileStoneWeight_Text
    lblCategorizeType.Text = dlgEditProperty_lblCategorizeType_Text
    
    chkDrawProgressLine.Label = dlgEditProperty_chkDrawProgressLine_Label
    chkPrintAllItems.Label = dlgEditProperty_chkPrintAllItems_Label
    chkPrintNotCompleted.Label = dlgEditProperty_chkPrintNotCompleted_Label
    chkInsertSpaceBetweenCategory.Label = _
        dlgEditProperty_chkInsertSpaceBetweenCategory_Label
    chkPrintLabel.Label = dlgEditProperty_chkPrintLabel_Label
    chkCalculateStatus.Label = dlgEditProperty_chkCalculateStatus_Label
    chkCalculateTimesWithoutHoliday.Label = _
        dlgEditProperty_chkCalculateTimesWithoutHoliday_Label
    chkUseOptionalNote.Label = dlgEditProperty_chkUseOptionalNote_Label
    btnOK.Label = dlgEditProperty_btnOK_Label
    
    cmbCellUnit.addItems(dlgEditProperty_cmbCellUnit_Items, 0)
    cmbChartBarType.addItems(dlgEditProperty_cmbChartBarType_Items, 0)
    lstCategorizeType.addItems(dlgEditProperty_lstCategorizeType_Items, 0)
    
End Sub
スポンサーサイト

テーマ:OpenOffice.org - ジャンル:コンピュータ

コメント
この記事へのコメント
コメントを投稿する
URL:
Comment:
Pass:
秘密: 管理者にだけ表示を許可する
 
トラックバック
この記事のトラックバックURL
http://shinob.blog42.fc2.com/tb.php/107-8f9accf1
この記事にトラックバックする(FC2ブログユーザー)
この記事へのトラックバック
COPYRIGHT(C) 2004 POWERD BY FC2 ALLRIGHT RESERVED.
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。