⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ganttdatabinder5.pas

📁 Gantt source file example to use in delphi 7
💻 PAS
📖 第 1 页 / 共 3 页
字号:
    function Get_Block_Length: WideString;
    function Get_Block_Title: WideString;
    function Get_Block_Colour: WideString;
    procedure Set_Block_Start(Value: WideString);
    procedure Set_Block_End(Value: WideString);
    procedure Set_Block_Length(Value: WideString);
    procedure Set_Block_Title(Value: WideString);
    procedure Set_Block_Colour(Value: WideString);
  end;

{ TXMLGantt_ProjectsType }

  TXMLGantt_ProjectsType = class(TXMLNodeCollection, IXMLGantt_ProjectsType)
  protected
    { IXMLGantt_ProjectsType }
    function Get_Gantt_Project(Index: Integer): IXMLGantt_ProjectType;
    function Add: IXMLGantt_ProjectType;
    function Insert(const Index: Integer): IXMLGantt_ProjectType;
  public
    procedure AfterConstruction; override;
  end;


  { TXMLGantt_ProjectType }

  TXMLGantt_ProjectType = class(TXMLNode, IXMLGantt_ProjectType)
  protected
    { IXMLGantt_ProjectType }
    function Get_Gantt_Project_Name: WideString;
    function Get_Gantt_Project_Resource1: IXMLGantt_Project_Resource1Type;
    function Get_Gantt_Project_Resource2: IXMLGantt_Project_Resource1Type;
    function Get_Gantt_Project_Items: IXMLGantt_Project_ItemsType;
    procedure Set_Gantt_Project_Name(Value: WideString);
  public
    procedure AfterConstruction; override;
  end;




{ TXMLGantt_Project_Resource1Type }

  TXMLGantt_Project_Resource1Type = class(TXMLNode, IXMLGantt_Project_Resource1Type)
  protected
    { IXMLGantt_Project_Resource1Type }
    function Get_Resource_ID: WideString;
    function Get_Resource_Name: WideString;
    function Get_Resource_Dept: WideString;
    function Get_Resource_Email: WideString;
    function Get_Resource_Company: WideString;
    procedure Set_Resource_ID(Value: WideString);
    procedure Set_Resource_Name(Value: WideString);
    procedure Set_Resource_Dept(Value: WideString);
    procedure Set_Resource_Email(Value: WideString);
    procedure Set_Resource_Company(Value: WideString);
  end;




{ TXMLGantt_Project_ItemsType }

  TXMLGantt_Project_ItemsType = class(TXMLNodeCollection, IXMLGantt_Project_ItemsType)
  protected
    { IXMLGantt_Project_ItemsType }
    function Get_Project_Item(Index: Integer): IXMLProject_ItemType;
    function Add: IXMLProject_ItemType;
    function Insert(const Index: Integer): IXMLProject_ItemType;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLProject_ItemType }

  TXMLProject_ItemType = class(TXMLNode, IXMLProject_ItemType)
  protected
    { IXMLProject_ItemType }
    function Get_Item_Name: WideString;
    function Get_Item_Type: WideString;
    function Get_Item_Status: WideString;
    function Get_Item_Percent_Completed: Integer;
    function Get_Item_Colour: WideString;
    function Get_Item_Start_Date: WideString;
    function Get_Item_End_Date: WideString;
    function Get_Item_Days: Integer;
    function Get_Item_Brush: IXMLItem_BrushType;
    function Get_Item_Pen: IXMLItem_PenType;
    function Get_Item_Link: IXMLItem_LinkType;
    function Get_Item_TextData: WideString;
    procedure Set_Item_Name(Value: WideString);
    procedure Set_Item_Type(Value: WideString);
    procedure Set_Item_Status(Value: WideString);
    procedure Set_Item_Percent_Completed(Value: Integer);
    procedure Set_Item_Colour(Value: WideString);
    procedure Set_Item_Start_Date(Value: WideString);
    procedure Set_Item_End_Date(Value: WideString);
    procedure Set_Item_Days(Value: Integer);
    procedure Set_Item_TextData(Value: WideString);
  public
    procedure AfterConstruction; override;
  end;

{ TXMLItem_BrushType }

  TXMLItem_BrushType = class(TXMLNode, IXMLItem_BrushType)
  protected
    { IXMLItem_BrushType }
    function Get_Item_Brush_Colour: WideString;
    function Get_Item_Brush_Style: WideString;
    procedure Set_Item_Brush_Colour(Value: WideString);
    procedure Set_Item_Brush_Style(Value: WideString);
  end;

{ TXMLItem_PenType }

  TXMLItem_PenType = class(TXMLNode, IXMLItem_PenType)
  protected
    { IXMLItem_PenType }
    function Get_Item_Pen_Colour: WideString;
    function Get_Item_Pen_Size: Integer;
    procedure Set_Item_Pen_Colour(Value: WideString);
    procedure Set_Item_Pen_Size(Value: Integer);
  end;

{ TXMLItem_LinkType }

  TXMLItem_LinkType = class(TXMLNode, IXMLItem_LinkType)
  protected
    { IXMLItem_LinkType }
    function Get_Project_ID: Integer;
    function Get_Item_ID: Integer;
    function Get_Link_Type : String;
    procedure Set_Project_ID(Value: Integer);
    procedure Set_Item_ID(Value: Integer);
    procedure Set_Link_Type(Value : String);
  end;

{ Global Functions }

function GetRoot_Element(Doc: IXMLDocument): IXMLRoot_ElementType;
function LoadRoot_Element(const FileName: WideString): IXMLRoot_ElementType;
function NewRoot_Element: IXMLRoot_ElementType;

implementation

{ Global Functions }

function GetRoot_Element(Doc: IXMLDocument): IXMLRoot_ElementType;
begin
  Result := Doc.GetDocBinding('Root_Element', TXMLRoot_ElementType) as IXMLRoot_ElementType;
end;
function LoadRoot_Element(const FileName: WideString): IXMLRoot_ElementType;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('Root_Element', TXMLRoot_ElementType) as IXMLRoot_ElementType;
end;

function NewRoot_Element: IXMLRoot_ElementType;
begin
  Result := NewXMLDocument.GetDocBinding('Root_Element', TXMLRoot_ElementType) as IXMLRoot_ElementType;
end;

{ TXMLRoot_ElementType }

procedure TXMLRoot_ElementType.AfterConstruction;
begin
  RegisterChildNode('Gantt_Chart', TXMLGantt_ChartType);
  inherited;
end;

function TXMLRoot_ElementType.Get_Gantt_Chart: IXMLGantt_ChartType;
begin
  Result := ChildNodes['Gantt_Chart'] as IXMLGantt_ChartType;
end;

{ TXMLGantt_ChartType }

procedure TXMLGantt_ChartType.AfterConstruction;
begin
  RegisterChildNode('Gantt_Chart_Details', TXMLGantt_Chart_DetailsType);
  RegisterChildNode('Gantt_Projects', TXMLGantt_ProjectsType);
  inherited;
end;

function TXMLGantt_ChartType.Get_Gantt_Chart_Details: IXMLGantt_Chart_DetailsType;
begin
  Result := ChildNodes['Gantt_Chart_Details'] as IXMLGantt_Chart_DetailsType;
end;

function TXMLGantt_ChartType.Get_Gantt_Projects: IXMLGantt_ProjectsType;
begin
  Result := ChildNodes['Gantt_Projects'] as IXMLGantt_ProjectsType;
end;

{ TXMLGantt_Chart_DetailsType }

procedure TXMLGantt_Chart_DetailsType.AfterConstruction;
begin
  RegisterChildNode('Chart_Date_Blocks', TXMLChart_Date_BlocksType);
  inherited;
end;

function TXMLGantt_Chart_DetailsType.Get_Gantt_Title: WideString;
begin
  Result := ChildNodes['Gantt_Title'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Gantt_Title(Value: WideString);
begin
  ChildNodes['Gantt_Title'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Start_Month: Integer;
begin
  Result := ChildNodes['Start_Month'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Start_Month(Value: Integer);
begin
  ChildNodes['Start_Month'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Number_of_Months: Integer;
begin
  Result := ChildNodes['Number_of_Months'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Number_of_Months(Value: Integer);
begin
  ChildNodes['Number_of_Months'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Project_Title_Colour: WideString;
begin
  Result := ChildNodes['Project_Title_Colour'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Project_Title_Colour(Value: WideString);
begin
  ChildNodes['Project_Title_Colour'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Project_Height: Integer;
begin
  Result := ChildNodes['Project_Height'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Project_Height(Value: Integer);
begin
  ChildNodes['Project_Height'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Day_Width: Integer;
begin
  Result := ChildNodes['Day_Width'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Day_Width(Value: Integer);
begin
  ChildNodes['Day_Width'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Shadow_Colour: WideString;
begin
  Result := ChildNodes['Shadow_Colour'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Shadow_Colour(Value: WideString);
begin
  ChildNodes['Shadow_Colour'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Gantt_Version: WideString;
begin
  Result := ChildNodes['Gantt_Version'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Gantt_Version(Value: WideString);
begin
  ChildNodes['Gantt_Version'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Gantt_Title_Box_Width: Integer;
begin
try
  Result := ChildNodes['Gantt_Title_Box_Width'].NodeValue;
  except
     result := 180;
  end
end;

procedure TXMLGantt_Chart_DetailsType.Set_Gantt_Title_Box_Width(Value: Integer);
begin
  ChildNodes['Gantt_Title_Box_Width'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Gantt_Title_Box_Height: Integer;
begin
try
  Result := ChildNodes['Gantt_Title_Box_Height'].NodeValue;
    except
     result := 50;
  end
end;

procedure TXMLGantt_Chart_DetailsType.Set_Gantt_Title_Box_Height(Value: Integer);
begin
  ChildNodes['Gantt_Title_Box_Height'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Grid_Lines_Colour: WideString;
begin
  Result := ChildNodes['Grid_Lines_Colour'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Grid_Lines_Colour(Value: WideString);
begin
  ChildNodes['Grid_Lines_Colour'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Grid_Weekend_Colour: WideString;
begin
  Result := ChildNodes['Grid_Weekend_Colour'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Grid_Weekend_Colour(Value: WideString);
begin
  ChildNodes['Grid_Weekend_Colour'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Project_Grid_Lines_Colour: WideString;
begin
  Result := ChildNodes['Project_Grid_Lines_Colour'].Text;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Project_Grid_Lines_Colour(Value: WideString);
begin
  ChildNodes['Project_Grid_Lines_Colour'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Show_Item_Length: Boolean;
begin
  Result := ChildNodes['Show_Item_Length'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Show_Item_Length(Value: Boolean);
begin
  ChildNodes['Show_Item_Length'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Show_Grid_Lines: Boolean;
begin
  Result := ChildNodes['Show_Grid_Lines'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Show_Grid_Lines(Value: Boolean);
begin
  ChildNodes['Show_Grid_Lines'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Show_Day_Text: Boolean;
begin
  Result := ChildNodes['Show_Day_Text'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Show_Day_Text(Value: Boolean);
begin
  ChildNodes['Show_Day_Text'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Show_Header_Weeks: Boolean;
begin
  Result := ChildNodes['Show_Header_Weeks'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Show_Header_Weeks(Value: Boolean);
begin
  ChildNodes['Show_Header_Weeks'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Show_Rounded_Titles: Boolean;
begin
  Result := ChildNodes['Show_Rounded_Titles'].NodeValue;
end;

procedure TXMLGantt_Chart_DetailsType.Set_Show_Rounded_Titles(Value: Boolean);
begin
  ChildNodes['Show_Rounded_Titles'].NodeValue := Value;
end;

function TXMLGantt_Chart_DetailsType.Get_Chart_Date_Blocks: IXMLChart_Date_BlocksType;
begin
  Result := ChildNodes['Chart_Date_Blocks'] as IXMLChart_Date_BlocksType;
end;

{ TXMLChart_Date_BlocksType }

procedure TXMLChart_Date_BlocksType.AfterConstruction;
begin
  RegisterChildNode('Date_Block', TXMLDate_BlockType);
  ItemTag := 'Date_Block';
  ItemInterface := IXMLDate_BlockType;
  inherited;
end;

function TXMLChart_Date_BlocksType.Get_Date_Block(Index: Integer): IXMLDate_BlockType;
begin
  Result := List[Index] as IXMLDate_BlockType;
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -