Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Interface

Читайте также:
  1. Interface
  2. Interface
  3. Interface
  4. Interface
  5. Interface

Uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, StdCtrls, Grids, Buttons, ToolWin, ActnMan, ActnCtrls,

ActnMenus, ActnList, XPStyleActnCtrls;

Type

TForm18 = class (TForm)

ActionMainMenuBar1: TActionMainMenuBar;

ActionManager2: TActionManager;

Action11: TAction;

Action12: TAction;

Action13: TAction;

lbCaption: TLabel;

ActionManager1: TActionManager;

Action1: TAction;

Action2: TAction;

Action3: TAction;

Action4: TAction;

Action5: TAction;

Action6: TAction;

Action7: TAction;

Action8: TAction;

Action9: TAction;

Action10: TAction;

StringGrid1: TStringGrid;

procedure FormShow(Sender: TObject);

procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;

Rect: TRect; State: TGridDrawState);

procedure Action11Execute(Sender: TObject);

procedure Action12Execute(Sender: TObject);

procedure Action13Execute(Sender: TObject);

procedure Shapka;

procedure Zapolnenie;

Private

Public

end;

Var

Form18: TForm18;

Implementation

uses Small_Business, PrnGridUnit, Programm, ShellAPI;

{**** Появление формы ****}

procedure TForm18.FormShow(Sender: TObject);

Begin

Shapka;

Zapolnenie;

end;

{**** Шапка таблиц ****}

procedure TForm18.Shapka;

Begin

// Ширина столбцов

StringGrid1.ColWidths[0]:= 400;

StringGrid1.ColWidths[1]:= 120;

StringGrid1.ColWidths[2]:= StringGrid1.ColWidths[1];

StringGrid1.ColWidths[3]:= StringGrid1.ColWidths[1];

StringGrid1.ColWidths[4]:= StringGrid1.ColWidths[1];

StringGrid1.ColWidths[5]:= StringGrid1.ColWidths[1];

// Шапка таблицы

StringGrid1.Cells[0, 0]:= ' Показатели';

StringGrid1.Cells[1, 0]:= ' 1 год (берутся данные на начало аналогичного предыдущего периода)';

StringGrid1.Cells[2, 0]:= ' 2 год (берутся данные на начало отчётного периода)';

StringGrid1.Cells[3, 0]:= ' Изменения (+/-)';

StringGrid1.Cells[4, 0]:= ' 3 год (берутся данные на конец отчётного периода)';

StringGrid1.Cells[5, 0]:= ' Изменения (+/-)';

StringGrid1.Cells[0, 1]:= ' Совокупные активы (пассивы) (СА)';

StringGrid1.Cells[0, 2]:= ' Скорректированные внеобортные активы (СВА)';

StringGrid1.Cells[0, 3]:= ' Оборотные активы (ОА)';

StringGrid1.Cells[0, 4]:= ' Ликвидные активы (ЛА)';

StringGrid1.Cells[0, 5]:= ' Наиболее ликвидные оборотные активы (НЛОА)';

StringGrid1.Cells[0, 6]:= ' Краткосрочная дебиторская задолженность (КДЗ)';

StringGrid1.Cells[0, 7]:= ' Собственные средства (СС)';

StringGrid1.Cells[0, 8]:= ' Обязательства предприятия (ОД)';

StringGrid1.Cells[0, 9]:= ' Текущие обязательства (ТКО)';

StringGrid1.Cells[0, 10]:= ' Валовая выручка (Впр)';

StringGrid1.Cells[0, 11]:= ' Среднемесячная выручка (Вср)';

StringGrid1.Cells[0, 12]:= ' Чистая прибыль (убыток) (ЧПр)';

StringGrid1.Cells[0, 13]:= ' Сумма всех доходов предприятия (Д)';

StringGrid1.Cells[0, 14]:= ' Потенциальные оборотные активы к возврату (ПОАВ)';

end;

{**** Заполнение таблиц ****}

procedure TForm18.Zapolnenie;

Var

i, j, m, f: Byte;

Begin

// 1 год

// m - столбец, f - строка, i - элемент

i:= 3;

m:= 1;

f:= 1; StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SVA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[LA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[NLOA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[KDZ, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SS, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OD, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[TKO, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vpr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vsr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[CHPr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[D, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[POAV, i]);

// 2 год

// m - столбец, f - строка, i - элемент

i:= 2;

m:= 2;

f:= 1; StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SVA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[LA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[NLOA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[KDZ, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SS, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OD, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[TKO, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vpr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vsr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[CHPr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[D, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[POAV, i]);

// 3 год

// m - столбец, f - строка, i - элемент

i:= 1;

m:= 4;

f:= 1; StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SVA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[LA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[NLOA, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[KDZ, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SS, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OD, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[TKO, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vpr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vsr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[CHPr, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[D, i]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[POAV, i]);

// Изменения # 1

// m - столбец, f - строка, i, j - элемент

i:= 3;

j:= 2;

m:= 3;

f:= 1; StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SA, i] - b[SA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SVA, i] - b[SVA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OA, i] - b[OA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[LA, i] - b[LA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[NLOA, i] - b[NLOA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[KDZ, i] - b[KDZ, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SS, i] - b[SS, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OD, i] - b[OD, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[TKO, i] - b[TKO, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vpr, i] - b[Vpr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vsr, i] - b[Vsr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[CHPr, i] - b[CHPr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[D, i] - b[D, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[POAV, i] - b[POAV, j]);

// Изменения # 2

i:= 1;

j:= 2;

m:= 5;

f:= 1; StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SA, i] - b[SA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SVA, i] - b[SVA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OA, i] - b[OA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[LA, i] - b[LA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[NLOA, i] - b[NLOA, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[KDZ, i] - b[KDZ, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[SS, i] - b[SS, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[OD, i] - b[OD, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[TKO, i] - b[TKO, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vpr, i] - b[Vpr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[Vsr, i] - b[Vsr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[CHPr, i] - b[CHPr, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[D, i] - b[D, j]);

inc(f); StringGrid1.Cells[m, f]:= FormatFloat('0.00', b[POAV, i] - b[POAV, j]);

end;

{**** Форматирование таблицы ****}

procedure TForm18.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;

Rect: TRect; State: TGridDrawState);

Var

s: String;

Flag: Cardinal;

H: Integer;

i, j, m: Byte;

Begin

{_________________Выделение цветом ячеек (для изменений #1 и #2)_______________}

for m:= 1 to 2 do // для того, чтобы заполнить два раза (т.е. два столбика)

Begin

for j:= 1 to 14 do // от 1 до 14 строчки

Begin

if m = 1 then i:= 3 // заполняем 3ий столбик

else i:= 5; // заполняем 5ый столбик

if (ACol = i) and (ARow = j) and (StrToFloat(StringGrid1.Cells[i, j]) >= 0) then

Begin

StringGrid1.Canvas.Brush.Color:= rgb(154, 255, 154); // салатовый

StringGrid1.Canvas.FillRect(Rect);

StringGrid1.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, StringGrid1.Cells[ACol, ARow]);

end;

if (ACol = i) and (ARow = j) and (StrToFloat(StringGrid1.Cells[i, j]) < 0) then

Begin

StringGrid1.Canvas.Brush.Color:= rgb(250, 128, 114); // розовый

StringGrid1.Canvas.FillRect(Rect);

StringGrid1.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, StringGrid1.Cells[ACol, ARow]);

end;

end;

end;

{________________________________________Выравнивание ячеек____________________}

StringGrid1.Canvas.FillRect(Rect);

s:= StringGrid1.Cells[ACol, ARow];

Flag:= DT_LEFT;

Flag:= Flag or DT_WORDBREAK;

Inc(Rect.Left, 0);

Dec(Rect.Right, 0);

H:= DrawText(StringGrid1.Canvas.Handle, PChar(s), Length(s), Rect, Flag);

if H > StringGrid1.RowHeights[ARow] then

StringGrid1.RowHeights[ARow]:= H; // Увеличиваем

end;

{**** Панель - Печать ****}

procedure TForm18.Action11Execute(Sender: TObject);

Begin

PrintGrid(StringGrid1, lbCaption);

end;

{**** Панель - Помощь ****}

procedure TForm18.Action12Execute(Sender: TObject);

Begin

ShellExecute(handle, 'open', 'helpfile.pdf', nil, nil, SW_SHOWNORMAL);

end;

{**** Панель - О программе ****}

procedure TForm18.Action13Execute(Sender: TObject);

Begin

Form22.Show;

end;

end.

 

2.1.2 UNIT SMALL_TABL_2

unit small_Tabl_2;


Дата добавления: 2015-10-13; просмотров: 66 | Нарушение авторских прав


Читайте в этой же книге: Основные показатели, характеризующие деловую активность | Основные показатели, характеризующие деловую активность | Коэффициенты эффективности деятельности | Диагностика банкротства предприятия | Исследовательский раздел | Модель TO-BE | Обоснование выбора языка и среды программирования | Описание главной формы | СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ | Private |
<== предыдущая страница | следующая страница ==>
Implementation| Interface

mybiblioteka.su - 2015-2024 год. (0.019 сек.)