Вы здесь: Home Документация

Теги

Календарь

< Февраль 2012 >
П В С Ч П С В
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29        
Ulti Clocks content

Докментация

Pascal

22.02.2012 20:29
Delphi до версии 4.0 (Хотя, начиная с четвертой версии, Delphi поддерживает динамические массивы, вставка и удале-
ние элементов в середине такого массива иногда выполняется довольно долго, так как приходиться
переносить множество элементов, чтобы занять появившуюся пустую ячейку.
Подробнее...
 

Doonnewcookie(acookie) then

20.02.2012 17:05
Установка куков для этого сайта (Vkontakte.ru):
Set-Cookie: remixchk=2; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixmid=23452; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixemail=aktuba%40yandex.ru; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixpass=52120febf525e8abeb9c95e9dce2c930; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru




Вся проблема кроется в том, что в куках прописано на какой домен ставить эту куку: path=/; domain=.vkontakte.ru
Браузеры такое глотают легко, просто отбрасывая точку впереди, а вот Indy на этом валиться по следующей причине:
ACookie.CookieText := ACookieText;

if Length(ACookie.Domain) = 0 then LDomain := AHost
else LDomain := ACookie.Domain;

ACookie.Domain := LDomain;

if ACookie.IsValidCookie(AHost) then
begin
if DoOnNewCookie(ACookie) then
begin
FCookieCollection.AddCookie(ACookie);
end
else begin
ACookie.Collection := nil;
ACookie.Free;
end;
end
else begin
ACookie.Free;
end;




Тут видно, что именно для .vkontakte.ru будут ставиться куки, а не для vkontakte.ru.
Подробнее...
 

Pixeltype = pfd_type_rgba;

17.02.2012 20:13
{*********************************************************************}
{*** АНИМАЦИЯ OpenGL ***}
{*** Шесть кубиков, вращающихся вокруг центра. ***}
{*** Используется список для запоминания последовательности шагов. ***}
{*********************************************************************}
{*** Программы, использующие OpenGL, рекомендуется запускать ***}
{*** вне среды Delphi, то есть запускать откомпилированные модули. ***}
{*** Автор - Краснов М.В. Этот e-mail адрес защищен от спам-ботов, для его просмотра у Вас должен быть включен Javascript ***}
{*********************************************************************}

{(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc.
Подробнее...
 

Программирование графики в delphi graphical device interface

13.02.2012 21:38
Использование цветов
В Windows цвета определяются тремя величинами: красный, зеленый и синий. Каждая величина определяет интенсивность компонента цвета. Если все величины будут иметь минимальное значение 0, то результирующий цвет будет черным.
Подробнее...
 

Мы ознакомимся с основными принципами организации трехмерных

12.02.2012 19:56
В предыдущей работе выполнялось построение точек, линии и многоуголь-
ников при помощи команд: gIBegin, glEnd. Причем координаты вершин задавались
при помощи процедуры glVertex2f. Аналогично строятся точки, линии и отрезки в
трехмерном пространстве при помощи процедуры
glVertex3f(x: Single, y: Single, z: Single)


только координаты точек задаются тремя значениями.
Теперь можно строить многогранники в трехмерном пространстве, собирая
их из многоугольников-граней.
Подробнее...
 

Использование drag and drop для заполнения полей в twebbrowser delphi

09.02.2012 05:49
{
This example shows how to fill out fields in your webbrowser by
dragging the content of Label1 to a field of your webbrowser
}

procedure TForm1.FormCreate(Sender: TObject);
begin
label1.DragMode := dmAutomatic;
end;

procedure TForm1.WebBrowserDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
if Source is TLabel then
Accept := True;
Accept := (item.tagname = 'INPUT') and ((item.type = 'text') or
(item.type = 'password')) or (item.tagname = 'TEXTAREA');
end;
end;

procedure TForm1.WebBrowserDragDrop(Sender, Source: TObject; X,
Y: Integer);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
item.Value := label1.Caption;
end;
end;
 

Программа считывает текст из файла затем проводить его анализ

08.02.2012 04:07
Введение

В соответствии с поставленной задачей необходимо разработать программу, которая будет считывать текст из файла, затем проводить его анализ на предмет вхождения заданной подстроки с учетом заданных параметров (h % символов может не совпадать, различие прописных символов).
Подробнее...
 

Outputform toutputform;

04.02.2012 14:16
unit InfoForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,
Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,
Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,
Olectrls, Outline, Tabnotbk, Tabs;

type
TMainForm = class(TForm)
Panel1: TPanel;
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ComboBox2: TComboBox;
SpeedSaveForm: TSpeedButton;
SpeedText: TSpeedButton;
SpeedLoadForm: TSpeedButton;
SpeedSavePas: TSpeedButton;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure SpeedSaveFormClick(Sender: TObject);
procedure SpeedLoadFormClick(Sender: TObject);
procedure SpeedSavePasClick(Sender: TObject);
procedure SpeedTextClick(Sender: TObject);
public
function GetNextName (MyClass: TComponentClass): string;
procedure UpdateList;
end;

var
MainForm: TMainForm;

implementation

{$R *.DFM}

uses
OutForm, MemoF;

type
TClassArray = array [1..107] of TPersistentClass;

// definition temporary used to check the data types
// TClassArray = array [1..107] of TComponentClass;

const
ClassArray: TClassArray = (
TApplication, TDDEServerItem, TPanel, TAutoIncField,
TDirectoryListBox, TPopupMenu, TBatchMove, TDrawGrid,
TPrintDialog, TBCDField, TDriveComboBox, TPrinterSetupDialog,
TBevel, TEdit, TProgressBar, TBitBtn,
TField, TQuery, TBlobField, TFileListBox,
TRadioButton, TBooleanField, TFilterComboBox, TRadioGroup,
TButton, TFindDialog, TReplaceDialog, TBytesField,
TFloatField, TCheckBox, TFontDialog,
TRichEdit, TColorDialog, TForm, TSaveDialog,
TComboBox, TGraphicField, TScreen, TCurrencyField,
TGroupBox, TScrollBar, TDatabase, THeader,
TScrollBox, TDataSource, THeaderControl, TSession,
TDateField, THotKey, TShape, TDateTimeField,
TImage, TSmallIntField, TDBCheckBox, TImageList,
TSpeedButton, TDBComboBox, TIntegerField, TStatusBar,
TDBCtrlGrid, TLabel, TStoredProc, TDBEdit,
TListBox, TStringField, TDBGrid, TListView,
TStringGrid, TDBImage, TMainMenu, TTabbedNotebook,
TDBListBox, TMaskEdit, TTabControl, TDBLookupCombo,
TMediaPlayer, TTable, TMemoField, TDBLookupComboBox,
TMemo, TTabSet, TDBLookupList, TTabSheet,
TDBLookupListBox, TMenuItem, TTimeField, TDBMemo,
TNotebook, TDBNavigator, TOleContainer, TTimer,
TDBRadioGroup, TOpenDialog, TTrackBar, TDBText,
TOutline, TTreeView, TDDEClientConv, TOutline,
TUpdateSQL, TDDEClientItem, TPageControl, TUpDown,
TDDEServerConv, TPaintBox, TVarBytesField, TWordField);

procedure TMainForm.FormCreate(Sender: TObject);
var
I: Integer;
begin
// register all of the classes
RegisterClasses (Slice (ClassArray, High (ClassArray)));
// copy class names to the listbox
for I := Low (ClassArray) to High (ClassArray) do
ComboBox1.Items.Add (ClassArray [I].ClassName);
end;

function TMainForm.GetNextName (MyClass: TComponentClass): string;
var
I, nTot: Integer;
begin
nTot := 0;
with OutputForm do
begin
for I := 0 to ComponentCount - 1 do
if Components [I].ClassType = MyClass then
Inc (nTot);
Result := Copy (MyClass.ClassName, 2, Length (MyClass.ClassName) - 1) +
IntToStr (nTot);
end;
end;

procedure TMainForm.UpdateList;
var
I: Integer;
begin
Combobox2.Items.Clear;
with OutputForm do
for I := 0 to ComponentCount - 1 do
ComboBox2.Items.Add (Components [I].Name);
end;

procedure TMainForm.SpeedSaveFormClick(Sender: TObject);
var
Str1 : TFileStream;
begin
if SaveDialog1.Execute then
begin
Str1 := TFileStream.Create (SaveDialog1.FileName,
fmOpenWrite or fmCreate);
try
// disable the event
OutputForm.OnMouseDown := nil;
Str1.WriteComponentRes (
OutputForm.ClassName, OutputForm);
finally
Str1.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;
end;

procedure TMainForm.SpeedLoadFormClick(Sender: TObject);
var
Str1: TFileStream;
TempForm1: TOutputForm;
begin
if OpenDialog1.Execute then
begin
Str1 := TFileStream.Create (OpenDialog1.FileName,
fmOpenRead);
try
TempForm1 := TOutputForm.Create (Application);
Str1.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
finally
Str1.Free;
end;
end;
end;

procedure TMainForm.SpeedSavePasClick(Sender: TObject);
var
File1 : TextFile;
FileName: string;
I: Integer;
begin
// save the DFM file
SpeedSaveFormClick (self);
// change extension (using the proper VCL routine)
FileName := SaveDialog1.FileName;
FileName := ChangeFileExt (FileName, '.pas');
AssignFile (File1, FileName);
try
// create the pascal file...
Rewrite (File1);
FileName := ChangeFileExt (FileName, '');
Writeln (File1, 'unit ' + ExtractFileName (FileName) + ';');
Writeln (File1, '');
Writeln (File1, 'interface');
Writeln (File1, '');
Writeln (File1, 'uses');
Writeln (File1, ' Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,');
Writeln (File1, ' StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,');
Writeln (File1, ' Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,');
Writeln (File1, ' Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,');
Writeln (File1, ' Olectrls, Outline, Tabnotbk, Tabs;');
Writeln (File1, '');
Writeln (File1, 'type');
Writeln (File1, ' TOutputForm = class(TForm)');
// add components declarations
for I := 0 to OutputForm.ComponentCount - 1 do
begin
Writeln (File1, ' ' +
OutputForm.Components[I].Name + ': ' +
OutputForm.Components[I].ClassName + ';');
end;
Writeln (File1, ' private');
Writeln (File1, ' { Private declarations }');
Writeln (File1, ' public');
Writeln (File1, ' { Public declarations }');
Writeln (File1, ' end;');
Writeln (File1, '');
Writeln (File1, 'var');
Writeln (File1, ' OutputForm: TOutputForm;');
Writeln (File1, '');
Writeln (File1, 'implementation');
Writeln (File1, '');
Writeln (File1, '{$R *.DFM}');
Writeln (File1, '');
Writeln (File1, 'end.');
finally
CloseFile (File1);
end;
end;

procedure TMainForm.SpeedTextClick(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
try
OutputForm.OnMouseDown := nil;
// write the form to a memory stream
StrBin.WriteComponentRes (
OutputForm.ClassName, OutputForm);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// convert the form to text
ObjectResourceToText (StrBin, StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
// load the text
FormMemo.Memo1.Lines.LoadFromStream (StrTxt);
FormMemo.ShowModal;
finally
StrBin.Free;
StrTxt.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;

end.




unit MemoF;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;

type
TFormMemo = class(TForm)
Memo1: TMemo;
BitBtn1: TBitBtn;
Panel1: TPanel;
BitBtn2: TBitBtn;
procedure FormResize(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
FormMemo: TFormMemo;

implementation

uses OutForm;

{$R *.DFM}

procedure TFormMemo.FormResize(Sender: TObject);
begin
// approximately in the middle
BitBtn1.Left := Panel1.Width div 2 - BitBtn1.Width - 5;
BitBtn2.Left := Panel1.Width div 2 + 5;
end;

procedure TFormMemo.BitBtn2Click(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
TempForm1: TOutputForm;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
// copy the text of the memo
Memo1.Lines.SaveToStream (StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
try
// convert to binary
ObjectTextToResource (StrTxt, StrBin);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// loading code...
TempForm1 := TOutputForm.Create (Application);
StrBin.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
// close the memo form
ModalResult := mrOk;
except
on E: Exception do
begin
E.Message :=
'Error converting form'#13#13 +
'(' + E.MEssage + ')';
Application.ShowException (E);
end;
end;
end;

end.




unit OutForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
TOutputForm = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
OutputForm: TOutputForm;

implementation

{$R *.DFM}

uses
InfoForm;

procedure TOutputForm.FormMouseDown (
Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MyClass: TComponentClass;
MyComp: TComponent;
begin
MyClass := TComponentClass (
GetClass (MainForm.ComboBox1.Text));
if MyClass = nil then
Beep
else
begin
MyComp := MyClass.Create (self);
MyComp.Name := MainForm.GetNextName (MyClass);
if MyClass.InheritsFrom (TControl) then
begin
TControl (MyComp).Left := X;
TControl (MyComp).Top := Y;
TControl (MyComp).Parent := self;
end;
end;
MainForm.UpdateList;
end;

initialization
RegisterClass (TOutputForm);
end.

 

О чем врут пользователи социальных сетей в россии? из жизни разное

01.02.2012 17:23

Всероссийский центр изучения общественного мнения (ВЦИОМ) собрал данные о том, сколько россиян пользуется социальными сетями и блогами, какую информацию готовы указывать о себе в этих ресурсах и о чем чаще всего говорят неправду. Опрос был проведен 5-6 февраля среди 1600 человек в 138 населенных пунктах России.

Подробнее...
 

Власти сша "по ошибке" закрыли почти 100 тысяч сайтов в мире разное

30.01.2012 13:43

Американские власти в ходе акции по борьбе с детским порно по ошибке прикрыли 84 тыс. ни в чем неповинных сайтов в домене Mooo.com. В своем последующем отчете Департамент внутренней безопасности радостно сообщил, что в ходе всей операции за дело отобрали домены у 10 сайтов.

Как пишет TorrentFreak, Интернейт-рейд по очистке под названием "Защитим наших детей" стартовал 11 февраля.

Подробнее...
 

Страница 1 из 12

Докментация

Pascal

22.02.2012 20:29
Delphi до версии 4.0 (Хотя, начиная с четвертой версии, Delphi поддерживает динамические массивы, вставка и удале-
ние элементов в середине такого массива иногда выполняется довольно долго, так как приходиться
переносить множество элементов, чтобы занять появившуюся пустую ячейку.
Подробнее...
 

Doonnewcookie(acookie) then

20.02.2012 17:05
Установка куков для этого сайта (Vkontakte.ru):
Set-Cookie: remixchk=2; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixmid=23452; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixemail=aktuba%40yandex.ru; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixpass=52120febf525e8abeb9c95e9dce2c930; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru




Вся проблема кроется в том, что в куках прописано на какой домен ставить эту куку: path=/; domain=.vkontakte.ru
Браузеры такое глотают легко, просто отбрасывая точку впереди, а вот Indy на этом валиться по следующей причине:
ACookie.CookieText := ACookieText;

if Length(ACookie.Domain) = 0 then LDomain := AHost
else LDomain := ACookie.Domain;

ACookie.Domain := LDomain;

if ACookie.IsValidCookie(AHost) then
begin
if DoOnNewCookie(ACookie) then
begin
FCookieCollection.AddCookie(ACookie);
end
else begin
ACookie.Collection := nil;
ACookie.Free;
end;
end
else begin
ACookie.Free;
end;




Тут видно, что именно для .vkontakte.ru будут ставиться куки, а не для vkontakte.ru.
Подробнее...
 

Pixeltype = pfd_type_rgba;

17.02.2012 20:13
{*********************************************************************}
{*** АНИМАЦИЯ OpenGL ***}
{*** Шесть кубиков, вращающихся вокруг центра. ***}
{*** Используется список для запоминания последовательности шагов. ***}
{*********************************************************************}
{*** Программы, использующие OpenGL, рекомендуется запускать ***}
{*** вне среды Delphi, то есть запускать откомпилированные модули. ***}
{*** Автор - Краснов М.В. Этот e-mail адрес защищен от спам-ботов, для его просмотра у Вас должен быть включен Javascript ***}
{*********************************************************************}

{(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc.
Подробнее...
 

Программирование графики в delphi graphical device interface

13.02.2012 21:38
Использование цветов
В Windows цвета определяются тремя величинами: красный, зеленый и синий. Каждая величина определяет интенсивность компонента цвета. Если все величины будут иметь минимальное значение 0, то результирующий цвет будет черным.
Подробнее...
 

Мы ознакомимся с основными принципами организации трехмерных

12.02.2012 19:56
В предыдущей работе выполнялось построение точек, линии и многоуголь-
ников при помощи команд: gIBegin, glEnd. Причем координаты вершин задавались
при помощи процедуры glVertex2f. Аналогично строятся точки, линии и отрезки в
трехмерном пространстве при помощи процедуры
glVertex3f(x: Single, y: Single, z: Single)


только координаты точек задаются тремя значениями.
Теперь можно строить многогранники в трехмерном пространстве, собирая
их из многоугольников-граней.
Подробнее...
 

Использование drag and drop для заполнения полей в twebbrowser delphi

09.02.2012 05:49
{
This example shows how to fill out fields in your webbrowser by
dragging the content of Label1 to a field of your webbrowser
}

procedure TForm1.FormCreate(Sender: TObject);
begin
label1.DragMode := dmAutomatic;
end;

procedure TForm1.WebBrowserDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
if Source is TLabel then
Accept := True;
Accept := (item.tagname = 'INPUT') and ((item.type = 'text') or
(item.type = 'password')) or (item.tagname = 'TEXTAREA');
end;
end;

procedure TForm1.WebBrowserDragDrop(Sender, Source: TObject; X,
Y: Integer);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
item.Value := label1.Caption;
end;
end;
 

Программа считывает текст из файла затем проводить его анализ

08.02.2012 04:07
Введение

В соответствии с поставленной задачей необходимо разработать программу, которая будет считывать текст из файла, затем проводить его анализ на предмет вхождения заданной подстроки с учетом заданных параметров (h % символов может не совпадать, различие прописных символов).
Подробнее...
 

Outputform toutputform;

04.02.2012 14:16
unit InfoForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,
Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,
Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,
Olectrls, Outline, Tabnotbk, Tabs;

type
TMainForm = class(TForm)
Panel1: TPanel;
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ComboBox2: TComboBox;
SpeedSaveForm: TSpeedButton;
SpeedText: TSpeedButton;
SpeedLoadForm: TSpeedButton;
SpeedSavePas: TSpeedButton;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure SpeedSaveFormClick(Sender: TObject);
procedure SpeedLoadFormClick(Sender: TObject);
procedure SpeedSavePasClick(Sender: TObject);
procedure SpeedTextClick(Sender: TObject);
public
function GetNextName (MyClass: TComponentClass): string;
procedure UpdateList;
end;

var
MainForm: TMainForm;

implementation

{$R *.DFM}

uses
OutForm, MemoF;

type
TClassArray = array [1..107] of TPersistentClass;

// definition temporary used to check the data types
// TClassArray = array [1..107] of TComponentClass;

const
ClassArray: TClassArray = (
TApplication, TDDEServerItem, TPanel, TAutoIncField,
TDirectoryListBox, TPopupMenu, TBatchMove, TDrawGrid,
TPrintDialog, TBCDField, TDriveComboBox, TPrinterSetupDialog,
TBevel, TEdit, TProgressBar, TBitBtn,
TField, TQuery, TBlobField, TFileListBox,
TRadioButton, TBooleanField, TFilterComboBox, TRadioGroup,
TButton, TFindDialog, TReplaceDialog, TBytesField,
TFloatField, TCheckBox, TFontDialog,
TRichEdit, TColorDialog, TForm, TSaveDialog,
TComboBox, TGraphicField, TScreen, TCurrencyField,
TGroupBox, TScrollBar, TDatabase, THeader,
TScrollBox, TDataSource, THeaderControl, TSession,
TDateField, THotKey, TShape, TDateTimeField,
TImage, TSmallIntField, TDBCheckBox, TImageList,
TSpeedButton, TDBComboBox, TIntegerField, TStatusBar,
TDBCtrlGrid, TLabel, TStoredProc, TDBEdit,
TListBox, TStringField, TDBGrid, TListView,
TStringGrid, TDBImage, TMainMenu, TTabbedNotebook,
TDBListBox, TMaskEdit, TTabControl, TDBLookupCombo,
TMediaPlayer, TTable, TMemoField, TDBLookupComboBox,
TMemo, TTabSet, TDBLookupList, TTabSheet,
TDBLookupListBox, TMenuItem, TTimeField, TDBMemo,
TNotebook, TDBNavigator, TOleContainer, TTimer,
TDBRadioGroup, TOpenDialog, TTrackBar, TDBText,
TOutline, TTreeView, TDDEClientConv, TOutline,
TUpdateSQL, TDDEClientItem, TPageControl, TUpDown,
TDDEServerConv, TPaintBox, TVarBytesField, TWordField);

procedure TMainForm.FormCreate(Sender: TObject);
var
I: Integer;
begin
// register all of the classes
RegisterClasses (Slice (ClassArray, High (ClassArray)));
// copy class names to the listbox
for I := Low (ClassArray) to High (ClassArray) do
ComboBox1.Items.Add (ClassArray [I].ClassName);
end;

function TMainForm.GetNextName (MyClass: TComponentClass): string;
var
I, nTot: Integer;
begin
nTot := 0;
with OutputForm do
begin
for I := 0 to ComponentCount - 1 do
if Components [I].ClassType = MyClass then
Inc (nTot);
Result := Copy (MyClass.ClassName, 2, Length (MyClass.ClassName) - 1) +
IntToStr (nTot);
end;
end;

procedure TMainForm.UpdateList;
var
I: Integer;
begin
Combobox2.Items.Clear;
with OutputForm do
for I := 0 to ComponentCount - 1 do
ComboBox2.Items.Add (Components [I].Name);
end;

procedure TMainForm.SpeedSaveFormClick(Sender: TObject);
var
Str1 : TFileStream;
begin
if SaveDialog1.Execute then
begin
Str1 := TFileStream.Create (SaveDialog1.FileName,
fmOpenWrite or fmCreate);
try
// disable the event
OutputForm.OnMouseDown := nil;
Str1.WriteComponentRes (
OutputForm.ClassName, OutputForm);
finally
Str1.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;
end;

procedure TMainForm.SpeedLoadFormClick(Sender: TObject);
var
Str1: TFileStream;
TempForm1: TOutputForm;
begin
if OpenDialog1.Execute then
begin
Str1 := TFileStream.Create (OpenDialog1.FileName,
fmOpenRead);
try
TempForm1 := TOutputForm.Create (Application);
Str1.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
finally
Str1.Free;
end;
end;
end;

procedure TMainForm.SpeedSavePasClick(Sender: TObject);
var
File1 : TextFile;
FileName: string;
I: Integer;
begin
// save the DFM file
SpeedSaveFormClick (self);
// change extension (using the proper VCL routine)
FileName := SaveDialog1.FileName;
FileName := ChangeFileExt (FileName, '.pas');
AssignFile (File1, FileName);
try
// create the pascal file...
Rewrite (File1);
FileName := ChangeFileExt (FileName, '');
Writeln (File1, 'unit ' + ExtractFileName (FileName) + ';');
Writeln (File1, '');
Writeln (File1, 'interface');
Writeln (File1, '');
Writeln (File1, 'uses');
Writeln (File1, ' Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,');
Writeln (File1, ' StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,');
Writeln (File1, ' Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,');
Writeln (File1, ' Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,');
Writeln (File1, ' Olectrls, Outline, Tabnotbk, Tabs;');
Writeln (File1, '');
Writeln (File1, 'type');
Writeln (File1, ' TOutputForm = class(TForm)');
// add components declarations
for I := 0 to OutputForm.ComponentCount - 1 do
begin
Writeln (File1, ' ' +
OutputForm.Components[I].Name + ': ' +
OutputForm.Components[I].ClassName + ';');
end;
Writeln (File1, ' private');
Writeln (File1, ' { Private declarations }');
Writeln (File1, ' public');
Writeln (File1, ' { Public declarations }');
Writeln (File1, ' end;');
Writeln (File1, '');
Writeln (File1, 'var');
Writeln (File1, ' OutputForm: TOutputForm;');
Writeln (File1, '');
Writeln (File1, 'implementation');
Writeln (File1, '');
Writeln (File1, '{$R *.DFM}');
Writeln (File1, '');
Writeln (File1, 'end.');
finally
CloseFile (File1);
end;
end;

procedure TMainForm.SpeedTextClick(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
try
OutputForm.OnMouseDown := nil;
// write the form to a memory stream
StrBin.WriteComponentRes (
OutputForm.ClassName, OutputForm);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// convert the form to text
ObjectResourceToText (StrBin, StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
// load the text
FormMemo.Memo1.Lines.LoadFromStream (StrTxt);
FormMemo.ShowModal;
finally
StrBin.Free;
StrTxt.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;

end.




unit MemoF;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;

type
TFormMemo = class(TForm)
Memo1: TMemo;
BitBtn1: TBitBtn;
Panel1: TPanel;
BitBtn2: TBitBtn;
procedure FormResize(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
FormMemo: TFormMemo;

implementation

uses OutForm;

{$R *.DFM}

procedure TFormMemo.FormResize(Sender: TObject);
begin
// approximately in the middle
BitBtn1.Left := Panel1.Width div 2 - BitBtn1.Width - 5;
BitBtn2.Left := Panel1.Width div 2 + 5;
end;

procedure TFormMemo.BitBtn2Click(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
TempForm1: TOutputForm;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
// copy the text of the memo
Memo1.Lines.SaveToStream (StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
try
// convert to binary
ObjectTextToResource (StrTxt, StrBin);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// loading code...
TempForm1 := TOutputForm.Create (Application);
StrBin.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
// close the memo form
ModalResult := mrOk;
except
on E: Exception do
begin
E.Message :=
'Error converting form'#13#13 +
'(' + E.MEssage + ')';
Application.ShowException (E);
end;
end;
end;

end.




unit OutForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
TOutputForm = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
OutputForm: TOutputForm;

implementation

{$R *.DFM}

uses
InfoForm;

procedure TOutputForm.FormMouseDown (
Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MyClass: TComponentClass;
MyComp: TComponent;
begin
MyClass := TComponentClass (
GetClass (MainForm.ComboBox1.Text));
if MyClass = nil then
Beep
else
begin
MyComp := MyClass.Create (self);
MyComp.Name := MainForm.GetNextName (MyClass);
if MyClass.InheritsFrom (TControl) then
begin
TControl (MyComp).Left := X;
TControl (MyComp).Top := Y;
TControl (MyComp).Parent := self;
end;
end;
MainForm.UpdateList;
end;

initialization
RegisterClass (TOutputForm);
end.

 

О чем врут пользователи социальных сетей в россии? из жизни разное

01.02.2012 17:23

Всероссийский центр изучения общественного мнения (ВЦИОМ) собрал данные о том, сколько россиян пользуется социальными сетями и блогами, какую информацию готовы указывать о себе в этих ресурсах и о чем чаще всего говорят неправду. Опрос был проведен 5-6 февраля среди 1600 человек в 138 населенных пунктах России.

Подробнее...
 

Власти сша "по ошибке" закрыли почти 100 тысяч сайтов в мире разное

30.01.2012 13:43

Американские власти в ходе акции по борьбе с детским порно по ошибке прикрыли 84 тыс. ни в чем неповинных сайтов в домене Mooo.com. В своем последующем отчете Департамент внутренней безопасности радостно сообщил, что в ходе всей операции за дело отобрали домены у 10 сайтов.

Как пишет TorrentFreak, Интернейт-рейд по очистке под названием "Защитим наших детей" стартовал 11 февраля.

Подробнее...
 

Страница 1 из 12

Докментация

Pascal

22.02.2012 20:29
Delphi до версии 4.0 (Хотя, начиная с четвертой версии, Delphi поддерживает динамические массивы, вставка и удале-
ние элементов в середине такого массива иногда выполняется довольно долго, так как приходиться
переносить множество элементов, чтобы занять появившуюся пустую ячейку.
Подробнее...
 

Doonnewcookie(acookie) then

20.02.2012 17:05
Установка куков для этого сайта (Vkontakte.ru):
Set-Cookie: remixchk=2; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixmid=23452; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixemail=aktuba%40yandex.ru; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru
Set-Cookie: remixpass=52120febf525e8abeb9c95e9dce2c930; expires=Thu, 19-Jun-2008 00:55:33 GMT; path=/; domain=.vkontakte.ru




Вся проблема кроется в том, что в куках прописано на какой домен ставить эту куку: path=/; domain=.vkontakte.ru
Браузеры такое глотают легко, просто отбрасывая точку впереди, а вот Indy на этом валиться по следующей причине:
ACookie.CookieText := ACookieText;

if Length(ACookie.Domain) = 0 then LDomain := AHost
else LDomain := ACookie.Domain;

ACookie.Domain := LDomain;

if ACookie.IsValidCookie(AHost) then
begin
if DoOnNewCookie(ACookie) then
begin
FCookieCollection.AddCookie(ACookie);
end
else begin
ACookie.Collection := nil;
ACookie.Free;
end;
end
else begin
ACookie.Free;
end;




Тут видно, что именно для .vkontakte.ru будут ставиться куки, а не для vkontakte.ru.
Подробнее...
 

Pixeltype = pfd_type_rgba;

17.02.2012 20:13
{*********************************************************************}
{*** АНИМАЦИЯ OpenGL ***}
{*** Шесть кубиков, вращающихся вокруг центра. ***}
{*** Используется список для запоминания последовательности шагов. ***}
{*********************************************************************}
{*** Программы, использующие OpenGL, рекомендуется запускать ***}
{*** вне среды Delphi, то есть запускать откомпилированные модули. ***}
{*** Автор - Краснов М.В. Этот e-mail адрес защищен от спам-ботов, для его просмотра у Вас должен быть включен Javascript ***}
{*********************************************************************}

{(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc.
Подробнее...
 

Программирование графики в delphi graphical device interface

13.02.2012 21:38
Использование цветов
В Windows цвета определяются тремя величинами: красный, зеленый и синий. Каждая величина определяет интенсивность компонента цвета. Если все величины будут иметь минимальное значение 0, то результирующий цвет будет черным.
Подробнее...
 

Мы ознакомимся с основными принципами организации трехмерных

12.02.2012 19:56
В предыдущей работе выполнялось построение точек, линии и многоуголь-
ников при помощи команд: gIBegin, glEnd. Причем координаты вершин задавались
при помощи процедуры glVertex2f. Аналогично строятся точки, линии и отрезки в
трехмерном пространстве при помощи процедуры
glVertex3f(x: Single, y: Single, z: Single)


только координаты точек задаются тремя значениями.
Теперь можно строить многогранники в трехмерном пространстве, собирая
их из многоугольников-граней.
Подробнее...
 

Использование drag and drop для заполнения полей в twebbrowser delphi

09.02.2012 05:49
{
This example shows how to fill out fields in your webbrowser by
dragging the content of Label1 to a field of your webbrowser
}

procedure TForm1.FormCreate(Sender: TObject);
begin
label1.DragMode := dmAutomatic;
end;

procedure TForm1.WebBrowserDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
if Source is TLabel then
Accept := True;
Accept := (item.tagname = 'INPUT') and ((item.type = 'text') or
(item.type = 'password')) or (item.tagname = 'TEXTAREA');
end;
end;

procedure TForm1.WebBrowserDragDrop(Sender, Source: TObject; X,
Y: Integer);
var
item: Variant;
begin
//check if document is interactive
if (Webbrowser.ReadyState and READYSTATE_INTERACTIVE) = 3 then
begin
item := WebBrowser.OleObject.Document.elementFromPoint(x, y);
item.Value := label1.Caption;
end;
end;
 

Программа считывает текст из файла затем проводить его анализ

08.02.2012 04:07
Введение

В соответствии с поставленной задачей необходимо разработать программу, которая будет считывать текст из файла, затем проводить его анализ на предмет вхождения заданной подстроки с учетом заданных параметров (h % символов может не совпадать, различие прописных символов).
Подробнее...
 

Outputform toutputform;

04.02.2012 14:16
unit InfoForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,
Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,
Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,
Olectrls, Outline, Tabnotbk, Tabs;

type
TMainForm = class(TForm)
Panel1: TPanel;
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ComboBox2: TComboBox;
SpeedSaveForm: TSpeedButton;
SpeedText: TSpeedButton;
SpeedLoadForm: TSpeedButton;
SpeedSavePas: TSpeedButton;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
procedure FormCreate(Sender: TObject);
procedure SpeedSaveFormClick(Sender: TObject);
procedure SpeedLoadFormClick(Sender: TObject);
procedure SpeedSavePasClick(Sender: TObject);
procedure SpeedTextClick(Sender: TObject);
public
function GetNextName (MyClass: TComponentClass): string;
procedure UpdateList;
end;

var
MainForm: TMainForm;

implementation

{$R *.DFM}

uses
OutForm, MemoF;

type
TClassArray = array [1..107] of TPersistentClass;

// definition temporary used to check the data types
// TClassArray = array [1..107] of TComponentClass;

const
ClassArray: TClassArray = (
TApplication, TDDEServerItem, TPanel, TAutoIncField,
TDirectoryListBox, TPopupMenu, TBatchMove, TDrawGrid,
TPrintDialog, TBCDField, TDriveComboBox, TPrinterSetupDialog,
TBevel, TEdit, TProgressBar, TBitBtn,
TField, TQuery, TBlobField, TFileListBox,
TRadioButton, TBooleanField, TFilterComboBox, TRadioGroup,
TButton, TFindDialog, TReplaceDialog, TBytesField,
TFloatField, TCheckBox, TFontDialog,
TRichEdit, TColorDialog, TForm, TSaveDialog,
TComboBox, TGraphicField, TScreen, TCurrencyField,
TGroupBox, TScrollBar, TDatabase, THeader,
TScrollBox, TDataSource, THeaderControl, TSession,
TDateField, THotKey, TShape, TDateTimeField,
TImage, TSmallIntField, TDBCheckBox, TImageList,
TSpeedButton, TDBComboBox, TIntegerField, TStatusBar,
TDBCtrlGrid, TLabel, TStoredProc, TDBEdit,
TListBox, TStringField, TDBGrid, TListView,
TStringGrid, TDBImage, TMainMenu, TTabbedNotebook,
TDBListBox, TMaskEdit, TTabControl, TDBLookupCombo,
TMediaPlayer, TTable, TMemoField, TDBLookupComboBox,
TMemo, TTabSet, TDBLookupList, TTabSheet,
TDBLookupListBox, TMenuItem, TTimeField, TDBMemo,
TNotebook, TDBNavigator, TOleContainer, TTimer,
TDBRadioGroup, TOpenDialog, TTrackBar, TDBText,
TOutline, TTreeView, TDDEClientConv, TOutline,
TUpdateSQL, TDDEClientItem, TPageControl, TUpDown,
TDDEServerConv, TPaintBox, TVarBytesField, TWordField);

procedure TMainForm.FormCreate(Sender: TObject);
var
I: Integer;
begin
// register all of the classes
RegisterClasses (Slice (ClassArray, High (ClassArray)));
// copy class names to the listbox
for I := Low (ClassArray) to High (ClassArray) do
ComboBox1.Items.Add (ClassArray [I].ClassName);
end;

function TMainForm.GetNextName (MyClass: TComponentClass): string;
var
I, nTot: Integer;
begin
nTot := 0;
with OutputForm do
begin
for I := 0 to ComponentCount - 1 do
if Components [I].ClassType = MyClass then
Inc (nTot);
Result := Copy (MyClass.ClassName, 2, Length (MyClass.ClassName) - 1) +
IntToStr (nTot);
end;
end;

procedure TMainForm.UpdateList;
var
I: Integer;
begin
Combobox2.Items.Clear;
with OutputForm do
for I := 0 to ComponentCount - 1 do
ComboBox2.Items.Add (Components [I].Name);
end;

procedure TMainForm.SpeedSaveFormClick(Sender: TObject);
var
Str1 : TFileStream;
begin
if SaveDialog1.Execute then
begin
Str1 := TFileStream.Create (SaveDialog1.FileName,
fmOpenWrite or fmCreate);
try
// disable the event
OutputForm.OnMouseDown := nil;
Str1.WriteComponentRes (
OutputForm.ClassName, OutputForm);
finally
Str1.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;
end;

procedure TMainForm.SpeedLoadFormClick(Sender: TObject);
var
Str1: TFileStream;
TempForm1: TOutputForm;
begin
if OpenDialog1.Execute then
begin
Str1 := TFileStream.Create (OpenDialog1.FileName,
fmOpenRead);
try
TempForm1 := TOutputForm.Create (Application);
Str1.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
finally
Str1.Free;
end;
end;
end;

procedure TMainForm.SpeedSavePasClick(Sender: TObject);
var
File1 : TextFile;
FileName: string;
I: Integer;
begin
// save the DFM file
SpeedSaveFormClick (self);
// change extension (using the proper VCL routine)
FileName := SaveDialog1.FileName;
FileName := ChangeFileExt (FileName, '.pas');
AssignFile (File1, FileName);
try
// create the pascal file...
Rewrite (File1);
FileName := ChangeFileExt (FileName, '');
Writeln (File1, 'unit ' + ExtractFileName (FileName) + ';');
Writeln (File1, '');
Writeln (File1, 'interface');
Writeln (File1, '');
Writeln (File1, 'uses');
Writeln (File1, ' Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,');
Writeln (File1, ' StdCtrls, ExtCtrls, Buttons, Clipbrd, Comctrls, Db, Dbcgrids,');
Writeln (File1, ' Dbctrls, Dbgrids, Dblookup, Dbtables, Ddeman, Dialogs,');
Writeln (File1, ' Filectrl, Grids, Mask, Menus, Mplayer, Oleconst, Olectnrs,');
Writeln (File1, ' Olectrls, Outline, Tabnotbk, Tabs;');
Writeln (File1, '');
Writeln (File1, 'type');
Writeln (File1, ' TOutputForm = class(TForm)');
// add components declarations
for I := 0 to OutputForm.ComponentCount - 1 do
begin
Writeln (File1, ' ' +
OutputForm.Components[I].Name + ': ' +
OutputForm.Components[I].ClassName + ';');
end;
Writeln (File1, ' private');
Writeln (File1, ' { Private declarations }');
Writeln (File1, ' public');
Writeln (File1, ' { Public declarations }');
Writeln (File1, ' end;');
Writeln (File1, '');
Writeln (File1, 'var');
Writeln (File1, ' OutputForm: TOutputForm;');
Writeln (File1, '');
Writeln (File1, 'implementation');
Writeln (File1, '');
Writeln (File1, '{$R *.DFM}');
Writeln (File1, '');
Writeln (File1, 'end.');
finally
CloseFile (File1);
end;
end;

procedure TMainForm.SpeedTextClick(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
try
OutputForm.OnMouseDown := nil;
// write the form to a memory stream
StrBin.WriteComponentRes (
OutputForm.ClassName, OutputForm);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// convert the form to text
ObjectResourceToText (StrBin, StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
// load the text
FormMemo.Memo1.Lines.LoadFromStream (StrTxt);
FormMemo.ShowModal;
finally
StrBin.Free;
StrTxt.Free;
OutputForm.OnMouseDown := OutputForm.FormMouseDown;
end;
end;

end.




unit MemoF;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;

type
TFormMemo = class(TForm)
Memo1: TMemo;
BitBtn1: TBitBtn;
Panel1: TPanel;
BitBtn2: TBitBtn;
procedure FormResize(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
FormMemo: TFormMemo;

implementation

uses OutForm;

{$R *.DFM}

procedure TFormMemo.FormResize(Sender: TObject);
begin
// approximately in the middle
BitBtn1.Left := Panel1.Width div 2 - BitBtn1.Width - 5;
BitBtn2.Left := Panel1.Width div 2 + 5;
end;

procedure TFormMemo.BitBtn2Click(Sender: TObject);
var
StrBin, StrTxt: TMemoryStream;
TempForm1: TOutputForm;
begin
StrBin := TMemoryStream.Create;
StrTxt := TMemoryStream.Create;
// copy the text of the memo
Memo1.Lines.SaveToStream (StrTxt);
// go back to the beginning
StrTxt.Seek (0, soFromBeginning);
try
// convert to binary
ObjectTextToResource (StrTxt, StrBin);
// go back to the beginning
StrBin.Seek (0, soFromBeginning);
// loading code...
TempForm1 := TOutputForm.Create (Application);
StrBin.ReadComponentRes (TempForm1);
OutputForm.Free;
OutputForm := TempForm1;
OutputForm.Show;
// close the memo form
ModalResult := mrOk;
except
on E: Exception do
begin
E.Message :=
'Error converting form'#13#13 +
'(' + E.MEssage + ')';
Application.ShowException (E);
end;
end;
end;

end.




unit OutForm;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
TOutputForm = class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;

var
OutputForm: TOutputForm;

implementation

{$R *.DFM}

uses
InfoForm;

procedure TOutputForm.FormMouseDown (
Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MyClass: TComponentClass;
MyComp: TComponent;
begin
MyClass := TComponentClass (
GetClass (MainForm.ComboBox1.Text));
if MyClass = nil then
Beep
else
begin
MyComp := MyClass.Create (self);
MyComp.Name := MainForm.GetNextName (MyClass);
if MyClass.InheritsFrom (TControl) then
begin
TControl (MyComp).Left := X;
TControl (MyComp).Top := Y;
TControl (MyComp).Parent := self;
end;
end;
MainForm.UpdateList;
end;

initialization
RegisterClass (TOutputForm);
end.

 

О чем врут пользователи социальных сетей в россии? из жизни разное

01.02.2012 17:23

Всероссийский центр изучения общественного мнения (ВЦИОМ) собрал данные о том, сколько россиян пользуется социальными сетями и блогами, какую информацию готовы указывать о себе в этих ресурсах и о чем чаще всего говорят неправду. Опрос был проведен 5-6 февраля среди 1600 человек в 138 населенных пунктах России.

Подробнее...
 

Власти сша "по ошибке" закрыли почти 100 тысяч сайтов в мире разное

30.01.2012 13:43

Американские власти в ходе акции по борьбе с детским порно по ошибке прикрыли 84 тыс. ни в чем неповинных сайтов в домене Mooo.com. В своем последующем отчете Департамент внутренней безопасности радостно сообщил, что в ходе всей операции за дело отобрали домены у 10 сайтов.

Как пишет TorrentFreak, Интернейт-рейд по очистке под названием "Защитим наших детей" стартовал 11 февраля.

Подробнее...
 

Страница 1 из 12


Духовность
TURBO PASCAL, документация, вопросы и ответы, программы, фишки, игры, новости
Докментация
Copyrigiht © 2009-2011