<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>edysoftware.com</title>
	<atom:link href="http://edysoftware.com/word/feed" rel="self" type="application/rss+xml" />
	<link>http://edysoftware.com/word</link>
	<description>open source masterhelp,macro, vba, word, cdma,component, delphi,excel</description>
	<pubDate>Fri, 07 Nov 2008 06:59:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>[Delphi] Using Tag On Tbutton</title>
		<link>http://edysoftware.com/word/source/2008/11/07/delphi-using-tag-on-tbutton.html</link>
		<comments>http://edysoftware.com/word/source/2008/11/07/delphi-using-tag-on-tbutton.html#comments</comments>
		<pubDate>Fri, 07 Nov 2008 06:59:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[button]]></category>

		<category><![CDATA[class]]></category>

		<category><![CDATA[componen]]></category>

		<category><![CDATA[sender]]></category>

		<category><![CDATA[Tag]]></category>

		<category><![CDATA[using tag]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=44</guid>
		<description><![CDATA[Delphi has Tag. Property , it&#8217;s can use to improve our coding. Not only that , we get more efficient in using procedure. For example we need 3 button to change form color became red, green and blue.

General :

procedure TForm1.Button1Click(Sender: TObject);
begin
color:=ClRed;

end;
procedure TForm1.Button2Click(Sender: TObject);
begin
color:=ClGreen;

end;
procedure TForm1.Button3Click(Sender: TObject);
begin
color:=ClBlue;

end;

Using Tag :

3 Procedures can became 1 procedure :.
Put number of [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">Delphi has <strong><span style="color: #ff6600;">Tag</span></strong>. Property , it&#8217;s can use to improve our coding. Not only that , we get more efficient in using procedure. For example we need 3 button to change form color became red, green and blue.</p>
<ul>
<li><strong><span style="color: #ff6600;">General :</span></strong></li>
</ul>
<p><strong>procedure </strong>TForm1.Button1Click(Sender: TObject);<br />
<strong>begin</strong></p>
<p>color:=<span style="color: #ff0000;">ClRed</span>;<br />
<strong><br />
end;</strong></p>
<p><strong>procedure </strong>TForm1.Button2Click(Sender: TObject);<br />
<strong>begin</strong></p>
<p>color:=<span style="color: #008000;">ClGreen</span>;<br />
<strong><br />
end;</strong></p>
<p><strong>procedure </strong>TForm1.Button3Click(Sender: TObject);<br />
<strong>begin</strong></p>
<p>color:=<span style="color: #3366ff;">ClBlue</span>;<br />
<strong><br />
end;</strong></p>
<ul>
<li><strong><span style="color: #ff6600;">Using Tag</span></strong> <strong><span style="color: #ff6600;">:</span></strong></li>
</ul>
<p align="justify">3 Procedures can became 1 procedure :.</p>
<p align="justify">Put number of Tag on each button</p>
<p align="justify"><span id="more-44"></span></p>
<ul>
<li>Button1 &#8211;&gt; Tag=0</li>
<li>Button2 &#8211;&gt; Tag=1</li>
<li>Button3 &#8211;&gt; Tag=2</li>
</ul>
<p>Every Button use <strong>Button1Click</strong>(Sender: TObject);</p>
<p><strong>procedure </strong>TForm1.Button1Click(Sender: TObject);<br />
<strong>begin</strong><br />
<strong>with </strong>Sender <strong>as <span style="color: #ff6600;">TButton</span></strong> <strong>do</strong><br />
<strong>begin</strong><br />
<strong>case <span style="color: #ff6600;">Tag</span></strong> <strong>of</strong><br />
0: color:=<span style="color: #ff0000;">ClRed</span>;<br />
1: color:=<span style="color: #008000;">ClGreen</span>;<br />
2: color:=<span style="color: #3366ff;">ClBlue</span>;<br />
<strong> end;<br />
end;<br />
end;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/11/07/delphi-using-tag-on-tbutton.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Show and Hide Taskbar</title>
		<link>http://edysoftware.com/word/source/2008/10/28/delphi-show-and-hide-taskbar.html</link>
		<comments>http://edysoftware.com/word/source/2008/10/28/delphi-show-and-hide-taskbar.html#comments</comments>
		<pubDate>Tue, 28 Oct 2008 02:58:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[hide]]></category>

		<category><![CDATA[show]]></category>

		<category><![CDATA[taksbar]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=43</guid>
		<description><![CDATA[The way to hide and show taskbar windows
procedure hideTaskbar;
var
wndHandle: THandle;
wndClass: array[0..50] of Char;
begin
StrPCopy(@wndClass[0], &#8216;Shell_TrayWnd&#8217;);
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_HIDE); // This hides the taskbar
end;

procedure showTaskbar;
var
wndHandle: THandle;
wndClass: array[0..50] of Char;
begin
StrPCopy(@wndClass[0], &#8216;Shell_TrayWnd&#8217;);
wndHandle := FindWindow(@wndClass[0], nil);
ShowWindow(wndHandle, SW_SHOWDEFAULT); // This restores the taskbar
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
 hideTaskbar;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
 showTaskbar;
end;
]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff6600;"><strong>The way to hide and show taskbar windows</strong></span></p>
<p><strong>procedure </strong>hideTaskbar;<br />
<strong>var</strong><br />
wndHandle: THandle;<br />
wndClass: array[0..50] of Char;<br />
<strong>begin</strong><br />
StrPCopy(@wndClass[0], &#8216;Shell_TrayWnd&#8217;);<br />
wndHandle := FindWindow(@wndClass[0], nil);<br />
ShowWindow(wndHandle, SW_HIDE); // This hides the taskbar<br />
<strong>end</strong>;</p>
<p><span id="more-43"></span></p>
<p><strong>procedure </strong>showTaskbar;<br />
<strong>var</strong><br />
wndHandle: THandle;<br />
wndClass: array[0..50] of Char;<br />
<strong>begin</strong><br />
StrPCopy(@wndClass[0], &#8216;Shell_TrayWnd&#8217;);<br />
wndHandle := FindWindow(@wndClass[0], nil);<br />
ShowWindow(wndHandle, SW_SHOWDEFAULT); // This restores the taskbar<br />
<strong>end</strong>;</p>
<p>procedure TForm1.Button1Click(Sender: TObject);<br />
begin<br />
<span style="color: #ff6600;"><strong> hideTaskbar;</strong></span><br />
end;</p>
<p>procedure TForm1.Button2Click(Sender: TObject);<br />
begin<br />
<span style="color: #ff6600;"><strong> showTaskbar;</strong></span><br />
end;</p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/10/28/delphi-show-and-hide-taskbar.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Compact Ms Access.mdb Using MsADO - JRO.dll</title>
		<link>http://edysoftware.com/word/source/2008/10/24/delphi-compact-ms-accessmdb-using-ado.html</link>
		<comments>http://edysoftware.com/word/source/2008/10/24/delphi-compact-ms-accessmdb-using-ado.html#comments</comments>
		<pubDate>Fri, 24 Oct 2008 09:08:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[ado]]></category>

		<category><![CDATA[compact database]]></category>

		<category><![CDATA[compact mdb]]></category>

		<category><![CDATA[jro]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=42</guid>
		<description><![CDATA[unit JRO_TLB;
// ************************************************************************ //
// WARNING
// &#8212;&#8212;-
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// &#8216;Refresh&#8217; command of the Type Library Editor activated while editing the
// Type Library, the [...]]]></description>
			<content:encoded><![CDATA[<p>unit JRO_TLB;</p>
<p>// ************************************************************************ //<br />
// WARNING<br />
// &#8212;&#8212;-<br />
// The types declared in this file were generated from data read from a<br />
// Type Library. If this type library is explicitly or indirectly (via<br />
// another type library referring to this type library) re-imported, or the<br />
// &#8216;Refresh&#8217; command of the Type Library Editor activated while editing the<br />
// Type Library, the contents of this file will be regenerated and all<br />
// manual modifications will be lost.<br />
// ************************************************************************ //<br />
<span id="more-42"></span><br />
// PASTLWTR : 1.2<br />
// File generated on 2004-2-16 8:40:08 from Type Library described below.</p>
<p>// ************************************************************************  //<br />
// <span style="color: #ff6600;"><strong>Type Lib: C:\Program Files\Common Files\System\ado\msjro.dll </strong></span>(1)<br />
// LIBID: {AC3B8B4C-B6CA-11D1-9F31-00C04FC29D52}<br />
// LCID: 0<br />
// Helpfile: C:\Program Files\Common Files\System\ado\msjro.chm<br />
// HelpString: Microsoft Jet and Replication Objects 2.6 Library<br />
// DepndLst:<br />
//   (1) v2.0 stdole, (C:\WINDOWS\System32\stdole2.tlb)<br />
//   (2) v2.7 ADODB, <span style="color: #ff6600;"><strong>(C:\Program Files\Common Files\System\ado\msado15.dll)</strong></span><br />
// Errors:<br />
//   Error creating palette bitmap of (TReplica) : Server C:\Program Files\Common Files\System\ado\msjro.dll contains no icons<br />
//   Error creating palette bitmap of (TJetEngine) : Server C:\Program Files\Common Files\System\ado\msjro.dll contains no icons<br />
// ************************************************************************ //<br />
// *************************************************************************//<br />
// NOTE:<br />
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties<br />
// which return objects that may need to be explicitly created via a function<br />
// call prior to any access via the property. These items have been disabled<br />
// in order to prevent accidental use from within the object inspector. You<br />
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively<br />
// removing them from the $IFDEF blocks. However, such items must still be<br />
// programmatically created via a method of the appropriate CoClass before<br />
// they can be used.<br />
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.<br />
{$WARN SYMBOL_PLATFORM OFF}<br />
{$WRITEABLECONST ON}<br />
{$VARPROPSETTER ON}<br />
interface</p>
<p>uses Windows, ActiveX, ADODB_TLB, Classes, Graphics, OleServer, StdVCL, Variants;</p>
<p>bla bla&#8230;..</p>
<p><strong>end. jro tlb</strong></p>
<p>unit UDataBaseCompact;</p>
<p>interface</p>
<p>uses<br />
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br />
Dialogs, StdCtrls, ExtCtrls, <span style="color: #ff6600;"><strong>JRO_TLB, OleServer</strong></span>, Buttons;</p>
<p><strong>procedure </strong>TForm_tool.DataBaseCompact;<br />
<strong>Var</strong><br />
oJetEngine:JetEngine;<br />
sourcefilename:String;<br />
tempfilename:String;<br />
soldmdb:String;<br />
snewmdb:String;<br />
checkfile:File;<br />
oldsize:Int64;<br />
newsize:Int64;<br />
<strong>Begin</strong><br />
sourcefilename:=&#8217;<span style="color: #3366ff;"><strong>c:\data.mdb</strong></span>&#8216;;</p>
<p>AssignFile(checkfile,sourcefilename);<br />
Reset(checkfile,1);<br />
oldsize:=FileSize(checkfile);<br />
CloseFile(checkfile);</p>
<p>tempfilename:=ChangeFileExt(sourcefilename,&#8217;.tmp&#8217;);<br />
soldmdb:=&#8217;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8217;+sourcefilename+&#8217;;Jet OLEDB:Database Password=&#8217;+Const_DBPassword;<br />
snewmdb:=&#8217;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&#8217;+tempfilename+&#8217;;Jet OLEDB:Database Password=&#8217;+Const_DBPassword;<br />
<strong>Try</strong><br />
<span style="color: #ff0000;"><strong> oJetEngine:=CoJetEngine.Create;<br />
oJetEngine.CompactDatabase(soldmdb,snewmdb);<br />
DeleteFile(sourcefilename);<br />
MoveFile(PChar(tempfilename),PChar(sourcefilename));</strong></span><br />
<strong>Except</strong><br />
DeleteFile(tempfilename);<br />
Self.Hide;<br />
Application.MessageBox(&#8217;Fail to compact database&#8217;+#13#13+&#8217;1.Make sure database isn&#8221;t being used by others.&#8217;+#13#13+&#8217;2.Make sure space of hard disk is enough.&#8217;+#13#13+&#8217;3.Please try again.&#8217;,PChar(Const_AppName),MB_IconError+MB_Ok);<br />
Close;<br />
<strong> End;</strong></p>
<p>AssignFile(checkfile,sourcefilename);<br />
Reset(checkfile,1);<br />
newsize:=FileSize(checkfile);<br />
CloseFile(checkfile);<br />
Label_After_BeforeCompactSizeDisplay.Caption:=FormatFloat(&#8217;###,###.##&#8221; KB&#8221;&#8216;,(oldsize/1024));<br />
Label_After_AfterCompactSizeDisplay.Caption:=FormatFloat(&#8217;###,###.##&#8221; KB&#8221;&#8216;,(newsize/1024));<br />
Label_After_CompactSizeDisplay.Caption:=FormatFloat(&#8217;###,###.##&#8221; KB&#8221;&#8216;,(oldsize-newsize)/1024);</p>
<p><strong>end;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/10/24/delphi-compact-ms-accessmdb-using-ado.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] read write text file</title>
		<link>http://edysoftware.com/word/source/2008/10/22/delphi-read-write-text-file.html</link>
		<comments>http://edysoftware.com/word/source/2008/10/22/delphi-read-write-text-file.html#comments</comments>
		<pubDate>Wed, 22 Oct 2008 05:24:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[read file]]></category>

		<category><![CDATA[write file text]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=41</guid>
		<description><![CDATA[Read And Write text file
procedure TForm1.Button3Click(Sender: TObject);
var

  F1, F2: TextFile;
  Ch: Char;
begin
  if OpenDialog1.Execute then begin
    AssignFile(F1, OpenDialog1.Filename);
    Reset(F1);
    if SaveDialog1.Execute then begin
      AssignFile(F2, SaveDialog1.Filename);
      Rewrite(F2);
      while not [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff6600;"><strong>Read And Write text file</strong></span></p>
<pre><strong>procedure </strong>TForm1.Button3Click(Sender: TObject);
<strong>var</strong>

  F1, F2: TextFile;
  Ch: Char;
<strong>begin
  if </strong>OpenDialog1.Execute <strong>then begin</strong>
    AssignFile(F1, OpenDialog1.Filename);
    Reset(F1);
    <strong>if</strong> SaveDialog1.Execute <strong>then begin</strong>
      AssignFile(F2, SaveDialog1.Filename);
      Rewrite(F2);
      <strong>while not </strong>Eof(F1) <strong>do</strong>
      <strong>begin</strong>
        Read(F1, Ch);
        Write(F2, Ch);
      <strong>end</strong>;
      <strong><span style="color: #ff6600;">writeln(f2,&#8217;add new data&#8217;);</span></strong>
      CloseFile(F2);
    <strong>end</strong>;
    CloseFile(F1);
<strong>  end
end;</strong></pre>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/10/22/delphi-read-write-text-file.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Program Structure</title>
		<link>http://edysoftware.com/word/source/2008/10/13/delphi-program-structure.html</link>
		<comments>http://edysoftware.com/word/source/2008/10/13/delphi-program-structure.html#comments</comments>
		<pubDate>Mon, 13 Oct 2008 07:41:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[Program structure]]></category>

		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=40</guid>
		<description><![CDATA[A program contains
a program heading,
a uses clause (optional), and
a block of declarations and statements.
The program heading specifies a name for the program. The uses clause lists units used by the program. The block contains declarations and statements that are executed when the program runs. The IDE expects to find these three elements in a single [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff6600;"><strong>A program contains</strong></span></p>
<p>a program heading,<br />
a uses clause (optional), and<br />
a block of declarations and statements.</p>
<p>The program heading specifies a name for the program. The uses clause lists units used by the program. The block contains declarations and statements that are executed when the program runs. The IDE expects to find these three elements in a single project (.dpr) file.<br />
<span id="more-40"></span><br />
The following example shows the project file for a program called Editor.</p>
<p>1     <strong>Program <span style="color: #ff6600;">Project1</span></strong>;<br />
2<br />
3     <strong>uses</strong><br />
4       QForms, {cross-platform Form}<br />
5       FrmAbout in &#8216;UAbout.pas&#8217; {AboutBox},<br />
6       FrmMain in &#8216;UMain.pas&#8217; {MainForm};<br />
7<br />
8     <span style="color: #3366ff;">{$R *.res}</span><br />
9<br />
10     <strong>begin</strong><br />
11       Application.Title := &#8216;First Project&#8217;;<br />
12       Application.CreateForm(TMainForm, MainForm);<br />
13       Application.Run;</p>
<p>14     <strong>end.</strong></p>
<p>Line 1 contains the program heading. The uses clause is on lines 3 through 6. Line 8 is a compiler directive that links the project&#8217;s resource file into the program. Lines 10 through 14 contain the block of statements that are executed when the program runs. Finally, the project file, like all source files, ends with a period.</p>
<p>This is, in fact, a fairly typical project file. Project files are usually short, since most of a program&#8217;s logic resides in its unit files. Project files are generated and maintained automatically, and it is seldom necessary to edit them manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/10/13/delphi-program-structure.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Get Ado Table Name One Line Command</title>
		<link>http://edysoftware.com/word/source/2008/10/08/get-ado-table-name-one-line-command.html</link>
		<comments>http://edysoftware.com/word/source/2008/10/08/get-ado-table-name-one-line-command.html#comments</comments>
		<pubDate>Wed, 08 Oct 2008 02:40:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[ado]]></category>

		<category><![CDATA[get tables name]]></category>

		<category><![CDATA[listbox]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=39</guid>
		<description><![CDATA[There is simple way to get table name from adoconnection. One line command.

Put adoconnection
Set active becaome true
Put Button
Put Listbox as destination of table names

unit Unit1;
interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB;
type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
ListBox1: TListBox;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ADOConnection1.GetTableNames(ListBox1.Items,true);
end;
end.
]]></description>
			<content:encoded><![CDATA[<p>There is simple way to get table name from adoconnection. One line command.</p>
<ul>
<li>Put adoconnection</li>
<li>Set active becaome true</li>
<li>Put Button</li>
<li>Put Listbox as destination of table names</li>
</ul>
<p><strong>unit </strong>Unit1;</p>
<p><strong>interface</strong></p>
<p><span id="more-39"></span></p>
<p><strong>uses</strong><br />
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br />
Dialogs, StdCtrls, DB, ADODB;</p>
<p>type<br />
TForm1 = class(TForm)<br />
ADOConnection1: TADOConnection;<br />
ListBox1: TListBox;<br />
Button1: TButton;<br />
procedure Button1Click(Sender: TObject);<br />
<strong>private</strong><br />
{ Private declarations }<br />
<strong>public</strong><br />
{ Public declarations }<br />
<strong>end</strong>;</p>
<p><strong>var</strong><br />
Form1: TForm1;</p>
<p><strong>implementation</strong></p>
<p><span style="color: #3366ff;">{$R *.dfm}</span></p>
<p><strong>procedure </strong>TForm1.Button1Click(Sender: TObject);<br />
<strong>begin</strong><br />
<span style="color: #ff6600;"><strong>ADOConnection1.GetTableNames(ListBox1.Items,true);<br />
</strong></span><strong>end</strong>;</p>
<p><strong>end</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/10/08/get-ado-table-name-one-line-command.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[delphi] Creating a bitmap for a component *.dcr</title>
		<link>http://edysoftware.com/word/source/2008/09/25/delphi-creating-a-bitmap-for-a-component-dcr.html</link>
		<comments>http://edysoftware.com/word/source/2008/09/25/delphi-creating-a-bitmap-for-a-component-dcr.html#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:46:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[bitmap component]]></category>

		<category><![CDATA[creating dcr file]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=38</guid>
		<description><![CDATA[Every component needs a bitmap to represent it on the Component palette. If we don&#8217;t specify our own bitmap, the IDE uses a default bitmap. Because the palette bitmaps are needed only at design time, we don&#8217;t compile them into the component&#8217;s compilation unit. Instead, we supply them in a Windows resource file with the [...]]]></description>
			<content:encoded><![CDATA[<p>Every component needs a bitmap to represent it on the Component palette. If we don&#8217;t specify our own bitmap, the IDE uses a default bitmap. Because the palette bitmaps are needed only at design time, we don&#8217;t compile them into the component&#8217;s compilation unit. Instead, we supply them in a Windows resource file with the same name as the unit., but with the .dcr (dynamic component resource) extension. we can create this resource file using the Image editor.</p>
<p>When we create a new component, we can define our own bitmaps for custom components.</p>
<p><span id="more-38"></span></p>
<p>To create a new bitmap:</p>
<ul>
<li> Choose Tools|Image Editor.</li>
<li> In the Image Editor dialog box, choose File|New|Component Resource File (.dcr).</li>
<li> In the untitled1.dcr dialog box, right-click Contents. Choose New|Bitmap.</li>
<li>In the Bitmaps Properties dialog box, change both the Width and Height to 24 pixels. Make sure VGA (16 colors) is checked. Click OK.</li>
</ul>
<ul>
<li>Bitmap and Bitmap1 appear below Contents. Select Bitmap1, right-click, and choose Rename. Give the bitmap the same name as the class name for our new component, including the T, using all uppercase letters. For example, if we new class name is going to be TMyNewButton, name the bitmap TMYNEWBUTTON.</li>
</ul>
<p><span style="color: #ff6600;"><strong>Note :<br />
</strong></span></p>
<p>we must name all uppercase letters, no matter how we spell the class name in the New Component dialog box.</p>
<ul>
<li>Double-click TMYNEWBUTTON to display a dialog box with an empty bitmap.</li>
</ul>
<ul>
<li> Use the color palette at the bottom of the Image Editor to design our icon.</li>
</ul>
<ul>
<li> Choose File|Save As and give the resource file (.dcr or .res) the same base name as the unit you want the component class declared in. For example, name the resource file MyNewButton.dcr.</li>
</ul>
<ul>
<li> Choose Component|New Component. Follow the instructions for creating a new component using the Component wizard. Make sure that the component source, MyNewButton.pas, is in the same directory as MyNewButton.dcr.</li>
</ul>
<p>The Component wizard, for a class named TMyNewButton, names the component source, or unit, MyNewButton.pas with a default placement in the LIB directory. Click the Browse button to find the new location for the generated component unit.</p>
<p><span style="color: #ff6600;"><strong>Note :</strong></span></p>
<p>If we are using a .res file for the bitmap rather than a .dcr file, then add a reference to the component source to bind the resource. For example, if our .res file is named MyNewButton.res, after ensuring that the .pas and .res are in the same directory, add the following to MyNewButton.pas below the type section:</p>
<p>{*R *.res}</p>
<ul>
<li>Choose Component|Install Component to install our component into a new or existing package. Click OK.</li>
</ul>
<p>our new package is built and then installed. The bitmap representing our new component appears on the Component palette page we designated in the Component wizard.</p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/09/25/delphi-creating-a-bitmap-for-a-component-dcr.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Create Component</title>
		<link>http://edysoftware.com/word/source/2008/09/25/delphi-create-component.html</link>
		<comments>http://edysoftware.com/word/source/2008/09/25/delphi-create-component.html#comments</comments>
		<pubDate>Thu, 25 Sep 2008 01:34:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[component delphi]]></category>

		<category><![CDATA[Create component]]></category>

		<category><![CDATA[step by step]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=37</guid>
		<description><![CDATA[we can use either of these methods to create a minimally functional component ready to install on the Component palette. After installing, you can add your new component to a form and test it at both design time and runtime. You can then add more features to the component, update the Component palette, and continue [...]]]></description>
			<content:encoded><![CDATA[<p><strong>we</strong> can use either of these methods to create a minimally functional component ready to install on the Component palette. After installing, you can add your new component to a form and test it at both design time and runtime. You can then add more features to the component, update the Component palette, and continue testing.</p>
<p>There are several basic steps that you perform whenever you create a new component. These steps are described below; other examples in this document assume that you know how to perform them.</p>
<ul>
<li>Create a unit for the new component.</li>
<li>Derive your component from an existing component type.</li>
<li>Add properties,methods, and events.</li>
<li>Register your component with the IDE.</li>
<li>Create a bitmap for the component.</li>
<li>Create a package (a special dynamic-link library) so that you can install your component in the IDE.</li>
<li>Create a Help file for your component and its properties, methods, and events.</li>
</ul>
<p>Note</p>
<p>Creating a Help file to instruct component users on how to use the component is optional.</p>
<p>When you finish, the complete component includes the following files:</p>
<p>A package (.BPL) or package collection (.DPC) file<br />
A compiled package (.DCP) file<br />
A compiled unit (.DCU) file<br />
A palette bitmap (.DCR) file<br />
A Help (.HLP) file</p>
<p>How to create a help file&#8230;..?  <a href="http://edysoftware.com/?pil=software">download this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/09/25/delphi-create-component.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] Statusbar with Traffic Lamp</title>
		<link>http://edysoftware.com/word/source/2008/09/16/delphi-statusbar-with-traffic-lamp.html</link>
		<comments>http://edysoftware.com/word/source/2008/09/16/delphi-statusbar-with-traffic-lamp.html#comments</comments>
		<pubDate>Tue, 16 Sep 2008 01:38:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[statusbar images]]></category>

		<category><![CDATA[statusbar traffic lamp]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=36</guid>
		<description><![CDATA[
How to make statusbar with images..?
we can draw icon on statusbar using canvas, or assign from imagelist. for this example we use imagelist, so we need 3 images to put in to imagelist : green, yellow and red.
Now ,
create new application, add button, imageslist, timer and statusbar. Add 3 images into imagelist and then double [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://edysoftware.com/delphi/statusbar.jpg" alt="statusbar" width="357" height="190" /></p>
<p>How to make statusbar with images..?</p>
<p>we can draw icon on statusbar using canvas, or assign from imagelist. for this example we use imagelist, so we need 3 images to put in to imagelist : green, yellow and red.</p>
<p>Now ,</p>
<p>create new application, add button, imageslist, timer and statusbar. Add 3 images into imagelist and then double click on statusbar</p>
<ul>
<li>add new status panel</li>
<li>Click on the second status panel</li>
<li><span style="color: #ff6600;"><strong>Change the style from psText to psOwnerDraw</strong></span></li>
</ul>
<ul>
<li>on  <span style="color: #ff6600;"><strong>StatusBar1DrawPanel</strong></span></li>
<li>Write this procedure :</li>
</ul>
<p><span id="more-36"></span></p>
<p><strong>procedure </strong>TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;<br />
Panel: TStatusPanel; const Rect: TRect);<br />
<strong>begin</strong><br />
// clear panel<br />
StatusBar1.Canvas.Pen.Color := StatusBar1.Canvas.Brush.Color;<br />
StatusBar1.Canvas.Rectangle(rect);<br />
StatusBar1.Canvas.Pen.Color := clWindowText;<br />
// draw icon and message<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left, Rect.Top, StatusIconIndex);<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left+15, Rect.Top, StatusIconIndex1);<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left+30, Rect.Top, StatusIconIndex2);<br />
StatusBar1.Canvas.TextOut(Rect.left + 51, Rect.top+1, StatusText);<br />
<strong>end; </strong></p>
<p>Create procedure to send message on statusbar</p>
<p><strong>procedure </strong>TForm1.showstatus(msg: string=&#8221;;  panel : Integer=0; busy: integer=0);<br />
<strong>begin</strong><br />
<strong>if</strong> panel = 1 <strong>then begin</strong><br />
StatusText := msg;<br />
<strong>case </strong>busy <strong>of</strong><br />
<strong> 0:<br />
begin</strong><br />
StatusIconIndex := 0;<br />
StatusIconIndex1 := 0;<br />
StatusIconIndex2 := 0;<br />
<strong> end;<br />
1:<br />
begin</strong><br />
StatusIconIndex := 2;<br />
StatusIconIndex1 := 1;<br />
StatusIconIndex2 := 0;<br />
<strong> end;<br />
2:<br />
begin</strong><br />
StatusIconIndex := 0;<br />
StatusIconIndex1 :=2;<br />
StatusIconIndex2 := 1;<br />
end;<br />
3:<br />
<strong> begin</strong><br />
StatusIconIndex := 1;<br />
StatusIconIndex1 := 0;<br />
StatusIconIndex2 := 2;<br />
<strong> end;<br />
end;</strong><br />
<strong>end</strong><br />
<strong>else</strong><br />
StatusBar1.Panels[panel].Text := msg;<br />
StatusBar1.Repaint;<br />
<strong>end</strong>;</p>
<p><span style="color: #ff6600;"><strong>Complete source</strong></span></p>
<p>unit Unit1;</p>
<p>interface</p>
<p>uses<br />
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br />
Dialogs, ComCtrls, ImgList, StdCtrls, ExtCtrls;</p>
<p>type<br />
TForm1 = class(TForm)<br />
Button1: TButton;<br />
ImageList1: TImageList;<br />
StatusBar1: TStatusBar;<br />
Button2: TButton;<br />
Timer1: TTimer;<br />
Button3: TButton;<br />
Button4: TButton;<br />
Button5: TButton;<br />
Button6: TButton;<br />
Button7: TButton;<br />
StatusBar2: TStatusBar;<br />
procedure Button1Click(Sender: TObject);<br />
procedure StatusBar1DrawPanel(StatusBar: TStatusBar;<br />
Panel: TStatusPanel; const Rect: TRect);<br />
procedure showstatus(msg: string=&#8221;;  panel : Integer=0; busy: integer=0);<br />
procedure Timer1Timer(Sender: TObject);<br />
procedure Button2Click(Sender: TObject);<br />
procedure Button3Click(Sender: TObject);<br />
procedure Button4Click(Sender: TObject);<br />
procedure Button5Click(Sender: TObject);<br />
procedure Button6Click(Sender: TObject);<br />
procedure Button7Click(Sender: TObject);<br />
private</p>
<p>{ Private declarations }<br />
public<br />
{ Public declarations }<br />
end;</p>
<p>var<br />
Form1: TForm1;<br />
StatusText          : String = &#8216;Initializing&#8230;&#8217;;<br />
StatusIconIndex     : Integer = 0;<br />
StatusIconIndex1     : Integer = 0;<br />
StatusIconIndex2     : Integer = 0;<br />
i:byte;<br />
implementation</p>
<p>{$R *.dfm}</p>
<p>procedure TForm1.showstatus(msg: string=&#8221;;  panel : Integer=0; busy: integer=0);<br />
begin<br />
if panel = 1 then begin<br />
StatusText := msg;<br />
case busy of<br />
0:<br />
begin<br />
StatusIconIndex := 0;<br />
StatusIconIndex1 := 0;<br />
StatusIconIndex2 := 0;<br />
end;<br />
1:<br />
begin<br />
StatusIconIndex := 2;<br />
StatusIconIndex1 := 1;<br />
StatusIconIndex2 := 0;<br />
end;<br />
2:<br />
begin<br />
StatusIconIndex := 0;<br />
StatusIconIndex1 :=2;<br />
StatusIconIndex2 := 1;<br />
end;<br />
3:<br />
begin<br />
StatusIconIndex := 1;<br />
StatusIconIndex1 := 0;<br />
StatusIconIndex2 := 2;<br />
end;<br />
end;<br />
end<br />
else<br />
StatusBar1.Panels[panel].Text := msg;<br />
StatusBar1.Repaint;<br />
end;</p>
<p>procedure TForm1.Button1Click(Sender: TObject);<br />
begin<br />
showstatus(&#8217;Disconnect&#8230;.&#8217;,1,1);<br />
//StatusBar1.Repaint;<br />
end;</p>
<p>procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;<br />
Panel: TStatusPanel; const Rect: TRect);<br />
begin<br />
// clear panel<br />
StatusBar1.Canvas.Pen.Color := StatusBar1.Canvas.Brush.Color;<br />
StatusBar1.Canvas.Rectangle(rect);<br />
StatusBar1.Canvas.Pen.Color := clWindowText;<br />
// draw icon and message<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left, Rect.Top, StatusIconIndex);<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left+15, Rect.Top, StatusIconIndex1);<br />
ImageList1.Draw(StatusBar1.Canvas, Rect.Left+30, Rect.Top, StatusIconIndex2);<br />
StatusBar1.Canvas.TextOut(Rect.left + 51, Rect.top+1, StatusText);<br />
end;</p>
<p>procedure TForm1.Timer1Timer(Sender: TObject);</p>
<p>begin<br />
if i&gt;3 then i:=0;</p>
<p>showstatus(&#8217;Connected&#8230;.&#8217;,1,i);<br />
inc(i);<br />
end;</p>
<p>procedure TForm1.Button2Click(Sender: TObject);<br />
begin<br />
Timer1.Enabled:=true;<br />
end;</p>
<p>procedure TForm1.Button3Click(Sender: TObject);<br />
begin<br />
showstatus(&#8217;Connected&#8230;.&#8217;,1,0);<br />
end;</p>
<p>procedure TForm1.Button4Click(Sender: TObject);<br />
begin<br />
showstatus(&#8217;Connected&#8230;.&#8217;,1,1);<br />
end;</p>
<p>procedure TForm1.Button5Click(Sender: TObject);<br />
begin<br />
showstatus(&#8217;Connected&#8230;.&#8217;,1,2);<br />
end;</p>
<p>procedure TForm1.Button6Click(Sender: TObject);<br />
begin<br />
showstatus(&#8217;Connected&#8230;.&#8217;,1,3);<br />
end;</p>
<p>procedure TForm1.Button7Click(Sender: TObject);<br />
begin<br />
if i&gt;3 then i:=0;</p>
<p>showstatus(&#8217;Connected&#8230;.&#8217;,1,i);<br />
sleep(50);<br />
inc(i);<br />
end;</p>
<p>end.</p>
<p>Source <a href="http://edysoftware.com/delphi/statusbar.zip">download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/09/16/delphi-statusbar-with-traffic-lamp.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Delphi] How to disabled Any Menu..?</title>
		<link>http://edysoftware.com/word/source/2008/08/22/delphi-how-to-disable-any-menus-delphi.html</link>
		<comments>http://edysoftware.com/word/source/2008/08/22/delphi-how-to-disable-any-menus-delphi.html#comments</comments>
		<pubDate>Fri, 22 Aug 2008 03:28:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Delphi]]></category>

		<category><![CDATA[Check menu]]></category>

		<category><![CDATA[menu caption]]></category>

		<category><![CDATA[menu item]]></category>

		<guid isPermaLink="false">http://edysoftware.com/word/?p=35</guid>
		<description><![CDATA[This is function to get menu caption, disable and enabled some menu, using loop we check if the component is class of tmenuitem we do something as we like, enabled, caption or another property
procedure TFrmMain.checkmenu;
var i:integer;

begin
for i:=0 to FrmMain.componentcount-1 do
begin
if FrmMain.components[i] is tmenuitem then
begin
with FrmMain.components[i] as tmenuitem do
begin
if (caption=&#8217;-') then enabled:=true
else
if (caption=&#8217;Login&#8217;) then enabled:=true
else
 if [...]]]></description>
			<content:encoded><![CDATA[<p>This is function to get menu caption, disable and enabled some menu, using loop we check if the component is class of <strong>tmenuitem</strong> we do something as we like, enabled, caption or another property</p>
<p><strong>procedure </strong>TFrmMain.<strong>checkmenu</strong>;<br />
<strong>var </strong>i:integer;<br />
<span id="more-35"></span><br />
<strong>begin<br />
for i</strong>:=0 <strong>to </strong>FrmMain.componentcount-1 <strong>do</strong><br />
<strong>begin</strong><br />
<strong>if</strong> FrmMain.components[i] <strong>is</strong> tmenuitem <strong>then</strong><br />
<strong>begin</strong><br />
<strong>with </strong>FrmMain.components[i] <strong>as</strong> tmenuitem <strong>do</strong><br />
<strong>begin</strong><br />
<strong>if </strong>(caption=&#8217;-') <strong>then </strong>enabled:=true<br />
<strong>else</strong><br />
<strong>if</strong> (caption=&#8217;Login&#8217;) <strong>then </strong>enabled:=true<br />
<strong>else</strong><br />
<strong> if</strong> (caption=&#8217;Logout&#8217;) <strong>then </strong>enabled:=true<br />
<strong>else</strong><br />
<strong>if</strong> (caption=&#8217;Exit&#8217;) <strong>then </strong>enabled:=true<br />
<strong>else</strong><br />
enabled:=false;<br />
<strong> end;<br />
end;<br />
end;<br />
end;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://edysoftware.com/word/source/2008/08/22/delphi-how-to-disable-any-menus-delphi.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
