Skip to content

DropFileDemo 项目分析

项目信息

  • 项目名称: DropFileDemo
  • 下载链接: DropFileDemo.rar
  • 分析时间: 2026-03-05

文件结构

DropFileDemo/
├── Extractor_Icon.ico
├── Project1.py
├── Project1.xml
├── Unit1.py
├── Unit1.pydfm
├── Unit1.sct
├── Unit1.sfm

主程序文件: Project1.py

from glcl import *
from Unit1 import *

def main():
    Application.Initialize()
    Application.Title = 'Project1'
    Application.MainFormOnTaskbar = True
    Application.Icon.LoadFromFile(os.path.join(os.path.dirname(os.path.abspath(__file__)), "Extractor_Icon.ico"))
    MainForm = DropFilesDemoForm(Application)
    MainForm.Show()
    FreeConsole()
    Application.Run()
    MainForm.Free()

if __name__ == '__main__':
    main()

单元文件: Unit1.py

import os
from glcl import *

class DropFilesDemoForm(Form):

    def __init__(self, owner):
        self.dfPanel = PJDropFiles(self)
        self.dfRTF = PJCtrlDropFiles(self)
        self.dfShape = PJDropFiles(self)
        self.Memo1 = Memo(self)
        self.chkFormIncFiles = CheckBox(self)
        self.chkPanelIncFiles = CheckBox(self)
        self.chkRTFIncFiles = CheckBox(self)
        self.chkShapeIncFiles = CheckBox(self)
        self.chkFormIncFolders = CheckBox(self)
        self.chkPanelIncFolders = CheckBox(self)
        self.chkRTFIncFolders = CheckBox(self)
        self.chkShapeIncFolders = CheckBox(self)
        self.chkFormRecurseFolders = CheckBox(self)
        self.chkPanelRecurseFolders = CheckBox(self)
        self.chkRTFRecurseFolders = CheckBox(self)
        self.chkShapeRecurseFolders = CheckBox(self)
        self.chkFormEnabled = CheckBox(self)
        self.chkPanelPassThru = CheckBox(self)
        self.chkPanelEnabled = CheckBox(self)
        self.chkRTFPassThru = CheckBox(self)
        self.chkRTFEnabled = CheckBox(self)
        self.chkShapePassThru = CheckBox(self)
        self.chkShapeEnabled = CheckBox(self)
        self.edExtensions = Edit(self)
        self.edWildcard = Edit(self)
        self.chkFormEnableFilter = CheckBox(self)
        self.chkPanelEnableFilter = CheckBox(self)
        self.chkRTFEnableFilter = CheckBox(self)
        self.chkFormShowRejections = CheckBox(self)
        self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "Unit1.pydfm"))
        self.dfShape.OnDropFiles = self.dfShapeDropFiles
        self.dfRTF.OnDropFiles = self.dfRTFDropFiles
        self.dfPanel.OnDropFiles = self.dfPanelDropFiles
        self.chkRTFEnableFilter.OnClick = self.chkRTFEnableFilterClick
        self.chkPanelEnableFilter.OnClick = self.chkPanelEnableFilterClick
        self.edWildcard.OnChange = self.edWildcardChange
        self.edExtensions.OnChange = self.edExtensionsChange
        self.dfForm.OnDropFiles = self.dfFormDropFiles
        self.chkFormEnabled.OnClick = self.chkFormEnabledClick
        self.chkShapeEnabled.OnClick = self.chkShapeEnabledClick
        self.chkShapePassThru.OnClick = self.chkShapePassThruClick
        self.chkRTFEnabled.OnClick = self.chkRTFEnabledClick
        self.chkRTFPassThru.OnClick = self.chkRTFPassThruClick
        self.chkPanelEnabled.OnClick = self.chkPanelEnabledClick
        self.chkPanelPassThru.OnClick = self.chkPanelPassThruClick
        self.chkFormIncFiles.OnClick = self.FormOptionsClick
        self.chkPanelIncFiles.OnClick = self.PanelOptionsClick
        self.chkRTFIncFiles.OnClick = self.RTFOptionsClick
        self.chkShapeIncFiles.OnClick = self.ShapeOptionsClick
        self.chkFormIncFolders.OnClick = self.FormOptionsClick
        self.chkPanelIncFolders.OnClick = self.PanelOptionsClick
        self.chkRTFIncFolders.OnClick = self.RTFOptionsClick
        self.chkShapeIncFolders.OnClick = self.ShapeOptionsClick
        self.chkFormRecurseFolders.OnClick = self.FormOptionsClick
        self.chkPanelRecurseFolders.OnClick = self.PanelOptionsClick
        self.chkRTFRecurseFolders.OnClick = self.RTFOptionsClick
        self.chkShapeRecurseFolders.OnClick = self.ShapeOptionsClick
        self.chkPanelEnabled.OnClick = self.FormOptionsClick
        self.chkFormShowRejections.OnClick = self.FormOptionsClick

        self.dfForm.OnFileFilter = self.dfFormFileFilter
        self.chkFormEnableFilter.OnClick = self.chkFormEnableFilterClick
        self.PJDropFilesOption = [dfoIncFolders, dfoIncFiles, dfoRecurseFolders]
        self.Caption = Application.Title
        self.chkFormIncFiles.Tag = self.PJDropFilesOption.index(dfoIncFiles)
        self.chkPanelIncFiles.Tag = self.PJDropFilesOption.index(dfoIncFiles)
        self.chkRTFIncFiles.Tag = self.PJDropFilesOption.index(dfoIncFiles)
        self.chkShapeIncFiles.Tag = self.PJDropFilesOption.index(dfoIncFiles)
        self.chkFormIncFolders.Tag = self.PJDropFilesOption.index(dfoIncFolders)
        self.chkPanelIncFolders.Tag = self.PJDropFilesOption.index(dfoIncFolders)
        self.chkRTFIncFolders.Tag = self.PJDropFilesOption.index(dfoIncFolders)
        self.chkShapeIncFolders.Tag = self.PJDropFilesOption.index(dfoIncFolders)
        self.chkFormRecurseFolders.Tag = self.PJDropFilesOption.index(dfoRecurseFolders)
        self.chkPanelRecurseFolders.Tag = self.PJDropFilesOption.index(dfoRecurseFolders)
        self.chkRTFRecurseFolders.Tag = self.PJDropFilesOption.index(dfoRecurseFolders)
        self.chkShapeRecurseFolders.Tag = self.PJDropFilesOption.index(dfoRecurseFolders)
        self.chkFormIncFiles.Checked = dfoIncFiles in self.dfForm.Options
        self.chkFormIncFolders.Checked = dfoIncFolders in self.dfForm.Options
        self.chkFormRecurseFolders.Checked = dfoRecurseFolders in self.dfForm.Options
        self.chkFormEnabled.Checked = self.dfForm.Enabled
        self.chkPanelIncFiles.Checked = dfoIncFiles in self.dfPanel.Options
        self.chkPanelIncFolders.Checked = dfoIncFolders in self.dfPanel.Options
        self.chkPanelRecurseFolders.Checked = dfoRecurseFolders in self.dfPanel.Options
        self.chkPanelPassThru.Checked = self.dfPanel.PassThrough
        self.chkPanelEnabled.Checked = self.dfPanel.Enabled
        self.chkRTFIncFiles.Checked = dfoIncFiles in self.dfRTF.Options
        self.chkRTFIncFolders.Checked = dfoIncFolders in self.dfRTF.Options
        self.chkRTFRecurseFolders.Checked = dfoRecurseFolders in self.dfRTF.Options
        self.chkRTFPassThru.Checked = self.dfRTF.PassThrough
        self.chkRTFEnabled.Checked = self.dfRTF.Enabled
        self.chkShapeIncFiles.Checked = dfoIncFiles in self.dfShape.Options
        self.chkShapeIncFolders.Checked = dfoIncFolders in self.dfShape.Options
        self.chkShapeRecurseFolders.Checked = dfoRecurseFolders in self.dfShape.Options
        self.chkShapePassThru.Checked = self.dfShape.PassThrough
        self.chkShapeEnabled.Checked = self.dfShape.Enabled
        self.edExtensions.Text = self.PanelExtFilter.Extensions
        self.edWildcard.Text = self.RTFWildcardFilter.WildCard
        self.chkFormEnableFilter.Checked = (self.dfForm.OnFileFilter != None)
        self.chkPanelEnableFilter.Checked = (self.dfPanel.Filter != None)
        self.chkRTFEnableFilter.Checked = (self.dfRTF.Filter != None)
        self.chkFormShowRejections.Checked = False
        self.Panel1.ParentBackground = False

    def FormOptionsClick(self, Sender):
        if Sender.Checked:
            self.dfForm.Options += [self.PJDropFilesOption[Sender.Tag]]
        else:
            self.dfForm.Options = list(set(self.dfForm.Options) - set([self.PJDropFilesOption[Sender.Tag]]))

    def PanelOptionsClick(self, Sender):
        if Sender.Checked:
            self.dfPanel.Options += [self.PJDropFilesOption[Sender.Tag]]
        else:
            self.dfPanel.Options = list(set(self.dfPanel.Options) - set([self.PJDropFilesOption[Sender.Tag]]))

    def RTFOptionsClick(self, Sender):
        if Sender.Checked:
            self.dfRTF.Options += [self.PJDropFilesOption[Sender.Tag]]
        else:
            self.dfRTF.Options = list(set(self.dfRTF.Options) - set([self.PJDropFilesOption[Sender.Tag]]))

    def ShapeOptionsClick(self, Sender):
        if Sender.Checked:
            self.dfShape.Options += [self.PJDropFilesOption[Sender.Tag]]
        else:
            self.dfShape.Options = list(set(self.dfShape.Options) - set([self.PJDropFilesOption[Sender.Tag]]))

    def chkFormEnableFilterClick(self, Sender):
        if self.chkFormEnableFilter.Checked:
            self.dfForm.OnFileFilter = self.dfFormFileFilter
        else:
            self.dfForm.OnFileFilter = None

    def dfFormFileFilter(self, Sender, FileName, IsFolder, Accept):
        if self.chkFormShowRejections.Checked:
            self.Memo1.Lines.Add('Rejected: ' + FileName)

    def chkPanelPassThruClick(self, Sender):
        self.dfPanel.PassThrough = self.chkPanelPassThru.Checked

    def chkPanelEnabledClick(self, Sender):
        self.dfPanel.Enabled = self.chkPanelEnabled.Checked

    def chkRTFPassThruClick(self, Sender):
        self.dfRTF.PassThrough = self.chkRTFPassThru.Checked

    def chkRTFEnabledClick(self, Sender):
        self.dfRTF.Enabled = self.chkRTFEnabled.Checked

    def chkShapePassThruClick(self, Sender):
        self.dfShape.PassThrough = self.chkShapePassThru.Checked

    def chkShapeEnabledClick(self, Sender):
        self.dfShape.Enabled = self.chkShapeEnabled.Checked

    def chkFormEnabledClick(self, Sender):
        self.dfForm.Enabled = self.chkFormEnabled.Checked

    def DropControlInfo(self, Ctrl, Point):
        return "%s at (%d.%d)" % (Ctrl.Name, Point.X, Point.Y)

    def dfFormDropFiles(self, Sender):
        for I in range(0, self.dfForm.Count):
            self.Memo1.Lines.Add('File: ' + self.dfForm.Files[I])
        self.Memo1.Lines.Add('Drop info: ' + self.DropControlInfo(self.dfForm.DropControl, self.dfForm.DropPoint))

    def edExtensionsChange(self, Sender):
        self.PanelExtFilter.Extensions = self.edExtensions.Text

    def edWildcardChange(self, Sender):
        self.RTFWildcardFilter.WildCard = self.edWildcard.Text

    def chkPanelEnableFilterClick(self, Sender):
        if self.chkPanelEnableFilter.Checked:
            self.dfPanel.Filter = self.PanelExtFilter
        else:
            self.dfPanel.Filter = None

    def chkRTFEnableFilterClick(self, Sender):
        if self.chkRTFEnableFilter.Checked:
            self.dfRTF.Filter = self.RTFWildcardFilter
        else:
            self.dfRTF.Filter = None

    def dfPanelDropFiles(self, Sender):
        for I in range(0, self.dfPanel.Count):
            self.Memo1.Lines.Add('File: ' + self.dfPanel.Files[I])
        self.Memo1.Lines.Add('Drop info: ' + self.DropControlInfo(self.dfPanel.DropControl, self.dfPanel.DropPoint))

    def dfRTFDropFiles(self, Sender):
        for I in range(0, self.dfRTF.Count):
            self.Memo1.Lines.Add('File: ' + self.dfRTF.Files[I])
        self.Memo1.Lines.Add('Drop info: ' + self.DropControlInfo(self.dfRTF.DropControl, self.dfRTF.DropPoint))

    def dfShapeDropFiles(self, Sender):
        for I in range(0, self.dfShape.Count):
            self.Memo1.Lines.Add('File: ' + self.dfShape.Files[I])
        self.Memo1.Lines.Add('Drop info: ' + self.DropControlInfo(self.dfShape.DropControl, self.dfShape.DropPoint))

设计文件: Unit1.sct

def chkFormEnableFilterClick(Sender): 
def dfFormFileFilter(Sender, FileName, IsFolder, Accept): 
def chkPanelPassThruClick(Sender): 
def chkPanelEnabledClick(Sender): 
def chkRTFPassThruClick(Sender): 
def chkRTFEnabledClick(Sender): 
def chkShapePassThruClick(Sender): 
def chkShapeEnabledClick(Sender): 
def chkFormEnabledClick(Sender): 
def dfFormDropFiles(Sender): 
def edExtensionsChange(Sender): 
def edWildcardChange(Sender): 
def chkPanelEnableFilterClick(Sender): 
def chkRTFEnableFilterClick(Sender): 
def dfPanelDropFiles(Sender): 
def dfRTFDropFiles(Sender): 
def dfShapeDropFiles(Sender): 

设计文件: Unit1.sfm

object DropFilesDemoForm: TForm
  Left = 0
  Top = 0
  BorderStyle = bsDialog
  Caption = 'DropFilesDemoForm'
  ClientHeight = 549
  ClientWidth = 781
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -12
  Font.Name = 'Arial'
  Font.Style = []
  Position = poScreenCenter
  Scaled = False
  TextHeight = 15
  object Label1: TLabel
    Left = 197
    Top = 197
    Width = 145
    Height = 15
    Caption = 'Blue Panel extension filter:'
  end
  object Label2: TLabel
    Left = 384
    Top = 197
    Width = 131
    Height = 15
    Caption = 'Pink RTF wildcard filter: '
  end
  object dfPanel: TPJDropFiles
    Left = 0
    Top = 299
    Width = 781
    Height = 55
    Align = alBottom
    TabOrder = 0
    Filter = PanelExtFilter
    ForegroundOnDrop = True
    Options = [dfoIncFolders, dfoIncFiles]
    PassThrough = False
    OnDropFiles = dfPanelDropFiles
    object Panel1: TPanel
      Left = 0
      Top = 0
      Width = 781
      Height = 55
      Align = alClient
      Caption = 'Panel1'
      Color = 16774636
      TabOrder = 0
      object Panel2: TPanel
        Left = 10
        Top = 9
        Width = 228
        Height = 40
        Caption = 'Panel2'
        ParentColor = True
        TabOrder = 0
      end
      object Panel3: TPanel
        Left = 542
        Top = 9
        Width = 227
        Height = 40
        Caption = 'Panel3'
        ParentColor = True
        TabOrder = 1
      end
    end
  end
  object Memo1: TMemo
    Left = 0
    Top = 354
    Width = 781
    Height = 195
    Align = alBottom
    Color = clLavenderblush
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'Arial'
    Font.Style = [fsBold]
    ParentFont = False
    ScrollBars = ssBoth
    TabOrder = 1
    WordWrap = False
  end
  object gbFormDropFiles: TGroupBox
    Left = 10
    Top = 10
    Width = 178
    Height = 149
    Caption = 'Drops on Form'
    TabOrder = 2
    object chkFormIncFiles: TCheckBox
      Left = 10
      Top = 30
      Width = 119
      Height = 20
      Caption = 'Include files'
      TabOrder = 0
    end
    object chkFormIncFolders: TCheckBox
      Left = 10
      Top = 59
      Width = 119
      Height = 21
      Caption = 'Include folders'
      TabOrder = 1
    end
    object chkFormRecurseFolders: TCheckBox
      Left = 10
      Top = 89
      Width = 119
      Height = 21
      Caption = 'Recurse Folders'
      TabOrder = 2
    end
    object chkFormEnabled: TCheckBox
      Left = 10
      Top = 118
      Width = 119
      Height = 21
      Caption = 'Enabled'
      TabOrder = 3
      OnClick = chkFormEnabledClick
    end
  end
  object gbDropFiles: TGroupBox
    Left = 197
    Top = 10
    Width = 178
    Height = 178
    Caption = 'Drops on Blue Panel'
    TabOrder = 3
    object chkPanelIncFiles: TCheckBox
      Left = 10
      Top = 30
      Width = 119
      Height = 20
      Caption = 'Include files'
      TabOrder = 0
    end
    object chkPanelIncFolders: TCheckBox
      Left = 10
      Top = 59
      Width = 119
      Height = 21
      Caption = 'Include folders'
      TabOrder = 1
    end
    object chkPanelRecurseFolders: TCheckBox
      Left = 10
      Top = 89
      Width = 119
      Height = 21
      Caption = 'Recurse Folders'
      TabOrder = 2
    end
    object chkPanelPassThru: TCheckBox
      Left = 10
      Top = 118
      Width = 119
      Height = 21
      Caption = 'Pass Through'
      TabOrder = 3
      OnClick = chkPanelPassThruClick
    end
    object chkPanelEnabled: TCheckBox
      Left = 10
      Top = 148
      Width = 119
      Height = 21
      Caption = 'Enabled'
      TabOrder = 4
      OnClick = chkPanelEnabledClick
    end
  end
  object gbCtrlDropFiles: TGroupBox
    Left = 384
    Top = 10
    Width = 178
    Height = 178
    Caption = 'Drops on Pink RTF'
    TabOrder = 4
    object chkRTFIncFiles: TCheckBox
      Left = 10
      Top = 30
      Width = 119
      Height = 20
      Caption = 'Include files'
      TabOrder = 0
    end
    object chkRTFIncFolders: TCheckBox
      Left = 10
      Top = 59
      Width = 119
      Height = 21
      Caption = 'Include folders'
      TabOrder = 1
    end
    object chkRTFRecurseFolders: TCheckBox
      Left = 10
      Top = 89
      Width = 119
      Height = 21
      Caption = 'Recurse Folders'
      TabOrder = 2
    end
    object chkRTFPassThru: TCheckBox
      Left = 10
      Top = 118
      Width = 119
      Height = 21
      Caption = 'Pass Through'
      TabOrder = 3
      OnClick = chkRTFPassThruClick
    end
    object chkRTFEnabled: TCheckBox
      Left = 10
      Top = 148
      Width = 119
      Height = 21
      Caption = 'Enabled'
      TabOrder = 4
      OnClick = chkRTFEnabledClick
    end
  end
  object edExtensions: TEdit
    Left = 197
    Top = 217
    Width = 149
    Height = 23
    Color = 16774636
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlue
    Font.Height = -12
    Font.Name = 'Arial'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 5
    Text = 'edExtensions'
    OnChange = edExtensionsChange
  end
  object edWildcard: TEdit
    Left = 384
    Top = 217
    Width = 149
    Height = 23
    Color = clLavenderblush
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -12
    Font.Name = 'Arial'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 6
    Text = 'edWildcard'
    OnChange = edWildcardChange
  end
  object chkFormEnableFilter: TCheckBox
    Left = 20
    Top = 246
    Width = 119
    Height = 21
    Caption = 'Enable filter'
    TabOrder = 7
    OnClick = chkFormEnableFilterClick
  end
  object chkFormShowRejections: TCheckBox
    Left = 20
    Top = 268
    Width = 168
    Height = 21
    Caption = 'Show rejected files'
    TabOrder = 8
  end
  object chkPanelEnableFilter: TCheckBox
    Left = 197
    Top = 246
    Width = 119
    Height = 21
    Caption = 'Enable filter'
    TabOrder = 9
    OnClick = chkPanelEnableFilterClick
  end
  object chkRTFEnableFilter: TCheckBox
    Left = 384
    Top = 246
    Width = 119
    Height = 21
    Caption = 'Enable filter'
    TabOrder = 10
    OnClick = chkRTFEnableFilterClick
  end
  object dfShape: TPJDropFiles
    Left = 574
    Top = 197
    Width = 176
    Height = 80
    TabOrder = 11
    ForegroundOnDrop = False
    Options = [dfoIncFolders, dfoIncFiles]
    PassThrough = False
    OnDropFiles = dfShapeDropFiles
    object Shape1: TShape
      Left = 0
      Top = 0
      Width = 176
      Height = 80
      Align = alClient
      Brush.Color = 13828050
    end
  end
  object GroupBox1: TGroupBox
    Left = 571
    Top = 10
    Width = 179
    Height = 178
    Caption = 'Drops on Green Shape'
    TabOrder = 12
    object chkShapeIncFiles: TCheckBox
      Left = 10
      Top = 30
      Width = 119
      Height = 20
      Caption = 'Include files'
      TabOrder = 0
    end
    object chkShapeIncFolders: TCheckBox
      Left = 10
      Top = 59
      Width = 119
      Height = 21
      Caption = 'Include folders'
      TabOrder = 1
    end
    object chkShapeRecurseFolders: TCheckBox
      Left = 10
      Top = 89
      Width = 119
      Height = 21
      Caption = 'Recurse Folders'
      TabOrder = 2
    end
    object chkShapePassThru: TCheckBox
      Left = 10
      Top = 118
      Width = 119
      Height = 21
      Caption = 'Pass Through'
      TabOrder = 3
      OnClick = chkShapePassThruClick
    end
    object chkShapeEnabled: TCheckBox
      Left = 10
      Top = 148
      Width = 119
      Height = 21
      Caption = 'Enabled'
      TabOrder = 4
      OnClick = chkShapeEnabledClick
    end
  end
  object dfForm: TPJFormDropFiles
    ForegroundOnDrop = True
    Options = [dfoIncFolders, dfoIncFiles]
    OnDropFiles = dfFormDropFiles
    OnFileFilter = dfFormFileFilter
    Left = 256
    Top = 304
  end
  object dfRTF: TPJCtrlDropFiles
    Filter = RTFWildcardFilter
    ForegroundOnDrop = True
    Options = [dfoIncFolders, dfoIncFiles]
    OnDropFiles = dfRTFDropFiles
    ManagedControl = Memo1
    Left = 8
    Top = 296
  end
  object PanelExtFilter: TPJExtFileFilter
    Extensions = '.pas;.dcu'
    Style = fsAll
    Left = 320
    Top = 304
  end
  object RTFWildcardFilter: TPJWildCardFileFilter
    WildCard = '*.*'
    Left = 288
    Top = 304
  end
end

其他文件

  • Extractor_Icon.ico
  • Project1.xml

详细分析

功能概述

GUI组件演示

使用的组件

  • DropFilesDemoForm (TForm)
  • Label1 (TLabel)
  • Label2 (TLabel)
  • dfPanel (TPJDropFiles)
  • Panel1 (TPanel)
  • Panel2 (TPanel)
  • Panel3 (TPanel)
  • Memo1 (TMemo)
  • gbFormDropFiles (TGroupBox)
  • chkFormIncFiles (TCheckBox)
  • chkFormIncFolders (TCheckBox)
  • chkFormRecurseFolders (TCheckBox)
  • chkFormEnabled (TCheckBox)
  • gbDropFiles (TGroupBox)
  • chkPanelIncFiles (TCheckBox)
  • chkPanelIncFolders (TCheckBox)
  • chkPanelRecurseFolders (TCheckBox)
  • chkPanelPassThru (TCheckBox)
  • chkPanelEnabled (TCheckBox)
  • gbCtrlDropFiles (TGroupBox)
  • chkRTFIncFiles (TCheckBox)
  • chkRTFIncFolders (TCheckBox)
  • chkRTFRecurseFolders (TCheckBox)
  • chkRTFPassThru (TCheckBox)
  • chkRTFEnabled (TCheckBox)
  • edExtensions (TEdit)
  • edWildcard (TEdit)
  • chkFormEnableFilter (TCheckBox)
  • chkFormShowRejections (TCheckBox)
  • chkPanelEnableFilter (TCheckBox)
  • chkRTFEnableFilter (TCheckBox)
  • dfShape (TPJDropFiles)
  • Shape1 (TShape)
  • GroupBox1 (TGroupBox)
  • chkShapeIncFiles (TCheckBox)
  • chkShapeIncFolders (TCheckBox)
  • chkShapeRecurseFolders (TCheckBox)
  • chkShapePassThru (TCheckBox)
  • chkShapeEnabled (TCheckBox)
  • dfForm (TPJFormDropFiles)
  • dfRTF (TPJCtrlDropFiles)
  • PanelExtFilter (TPJExtFileFilter)
  • RTFWildcardFilter (TPJWildCardFileFilter)

技术特点

  • 包含43个GUI组件
  • 定义26个事件处理

窗体属性

  • caption: Enabled
  • height: 549
  • width: 781

代码分析

导入的模块: - import os - from glcl import *

定义的类: - DropFilesDemoForm

定义的方法: - init - FormOptionsClick - PanelOptionsClick - RTFOptionsClick - ShapeOptionsClick - chkFormEnableFilterClick - dfFormFileFilter - chkPanelPassThruClick - chkPanelEnabledClick - chkRTFPassThruClick - chkRTFEnabledClick - chkShapePassThruClick - chkShapeEnabledClick - chkFormEnabledClick - DropControlInfo - dfFormDropFiles - edExtensionsChange - edWildcardChange - chkPanelEnableFilterClick - chkRTFEnableFilterClick - dfPanelDropFiles - dfRTFDropFiles - dfShapeDropFiles

事件绑定: - self.chkRTFEnableFilter.OnClick = self.chkRTFEnableFilterClick - self.chkPanelEnableFilter.OnClick = self.chkPanelEnableFilterClick - self.edWildcard.OnChange = self.edWildcardChange - self.edExtensions.OnChange = self.edExtensionsChange - self.chkFormEnabled.OnClick = self.chkFormEnabledClick - self.chkShapeEnabled.OnClick = self.chkShapeEnabledClick - self.chkShapePassThru.OnClick = self.chkShapePassThruClick - self.chkRTFEnabled.OnClick = self.chkRTFEnabledClick - self.chkRTFPassThru.OnClick = self.chkRTFPassThruClick - self.chkPanelEnabled.OnClick = self.chkPanelEnabledClick - self.chkPanelPassThru.OnClick = self.chkPanelPassThruClick - self.chkFormIncFiles.OnClick = self.FormOptionsClick - self.chkPanelIncFiles.OnClick = self.PanelOptionsClick - self.chkRTFIncFiles.OnClick = self.RTFOptionsClick - self.chkShapeIncFiles.OnClick = self.ShapeOptionsClick - self.chkFormIncFolders.OnClick = self.FormOptionsClick - self.chkPanelIncFolders.OnClick = self.PanelOptionsClick - self.chkRTFIncFolders.OnClick = self.RTFOptionsClick - self.chkShapeIncFolders.OnClick = self.ShapeOptionsClick - self.chkFormRecurseFolders.OnClick = self.FormOptionsClick - self.chkPanelRecurseFolders.OnClick = self.PanelOptionsClick - self.chkRTFRecurseFolders.OnClick = self.RTFOptionsClick - self.chkShapeRecurseFolders.OnClick = self.ShapeOptionsClick - self.chkPanelEnabled.OnClick = self.FormOptionsClick - self.chkFormShowRejections.OnClick = self.FormOptionsClick - self.chkFormEnableFilter.OnClick = self.chkFormEnableFilterClick