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

📄 readme.htm

📁 Delphi 窗口状态记录控件
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

	<title>
		DelphiDabbler.com Info Sheet: Window State Components
	</title>

	<style type="text/css">
		<!--
		body {
			margin: 1em;
			padding: 0;
			font-family: Verdana, Arial, sans-serif;
			font-size: 9pt;
			line-height: 150%;
		}
		h1 {
			margin: 0 0 1em 0;
			padding: 0.5em;
			border: 1px silver solid;
			background-color: #eee;
			font-size: 13pt;
			font-weight: bold;
			text-align: center;
		}
		h1 .subtitle {
			font-style: italic;
			color: #336;
		}
		h2 {
			margin: 1em 0 0 0;
			padding: 0;
			padding-bottom: 6px;
			border-bottom: 1px silver solid;
			font-size: 11pt;
			font-weight: bold;
		}
		h3 {
			margin: 0.5em 0 0 0;
			padding: 0;
			font-size: 9pt;
			font-weight: bold;
		}
		p {
			margin: 0.5em 0 0 0;
			padding: 0;
		}
		ul, ol {
			margin: 0.5em 0 0 3em;
			padding: 0;
		}
		ul {
			list-style-type: square;
		}
		ul.spaced li,
		ol.spaced li {
			margin-top: 0.5em;
		}
		ul.spaced li,
		ol.spaced li {
			margin-top: 0.5em;
		}
		ul.unspaced li,
		ol.unspaced li {
			margin-top: 0;
		}
		ul.unspaced li.first,
		ol.unspaced li.first {
			margin-top: 0.5em;
		}
		code {
			font-family: "Courier New", Courier, monospace;
		}
		a:link {
			color: #336;
			text-decoration: underline;
		}
		a:visited {
			color: #669;
			text-decoration: underline;
		}
		a:active {
			color: #336;
			text-decoration: underline;
		}
		a:hover {
			text-decoration: underline;
		}
		.gototop {
			margin: 1em 0 0 0;
			padding: 0.3em 0 0 0;
			text-align: center;
			position: relative;
			float: right;
			font-weight: bold;
		}
		.pullout {
			border-left: 8px silver solid;
			xborder-bottom: 2px silver solid;
			xborder-top: 2px silver solid;
			background-color: #eee;
			margin: 0.5em 0 0 0;
			padding: 0.25em 0.5em;
			font-style: italic;
		}
		.indent {
			margin-left: 3em;
		}
		.highlight {
			color: #336;
			font-style: italic;
			font-weight: bold;
		}
		.endnotes {
			margin: 1.5em 0 0 0;
			padding: 1em 0 0 0;
			border-top: 1px silver solid;
		}
		.comments {
			font-style: italic;
		}
		.copyright,
		.copyright a:link,
		.copyright a:visited,
		.copyright a:active {
			margin: 1em 0 0 0;
			color: gray;
			font-size: 8pt;
			text-align: right;
		}
		-->
	</style>

</head>

<body>

<h1>
	Window State Components<br />
	<span class="subtitle">Information Sheet</span>
</h1>


<h2 id="contents">
	Contents
</h2>

<ul>
	<li><a href="#overview">Overview</a></li>
	<li><a href="#compatibility">Compatibility</a></li>
	<li><a href="#installation">Installation</a></li>
	<li><a href="#changelog">Change log</a></li>
	<li><a href="#license">License</a></li>
	<li><a href="#author">About the Author</a></li>
</ul>


<p class="gototop">
	&raquo; <a href="#contents">Contents</a>
</p>

<h2 id="overview">
	Overview
</h2>

<p>
	The window state components can save and restore a window's size, position
	and state (minimized, maximized or normal) between program executions. Three
	components are provided that use different means of recording the window's
	information. They are:
</p>

<ul class="spaced">

	<li>
		<span class="highlight">TPJWdwState</span><br />
		This component records window information in an ini file. The user has
		control over the ini file name (via the <var>IniFileName</var> property)
		and the name of the section of the file where window information is
		recorded (using the <var>Section</var> property). Alternatively the ini
		and section names can be configured by handling the
		<var>OnGetIniData</var> event that is triggered immediately before the
		ini file is read or written.
	</li>

	<li>
		<span class="highlight">TPJRegWdwState</span><br />
		This component uses the registry to record window information. The
		registry root key and sub key where the information is stored are
		controlled by the <var>RootKey</var> and <var>SubKey</var> properties,
		or by handling the <var>OnGetRegData</var> event. This event is
		triggered just before the registry is accessed. Additional application
		defined data can be read from or written to the registry by handling the
		<var>OnGettingRegData</var> and <var>OnPuttingRegData</var> events that
		are triggered after the component reads or writes the registry.
	</li>
	
	<li>
		<span class="highlight">TPJUserWdwState</span><br />
		This component relies on the user to handle saving and reading the
		window state data to or from persistent storage. The component gives the
		most flexibility of all the components at the expense of placing the
		storage burden on the user. The component triggers <var>OnReadData</var>
		and <var>OnSaveData</var> events when ready to read or save data.
	</li>

</ul>

<p>
	All components implement the same functionality, controlled by some
	common properties and events, as follows:
</p>

<ul class="spaced">

	<li>
		The components can automatically restore and save windows when the
		program starts up and closes down (using the <var>AutoSaveRestore</var>
		property). If <var>AutoSaveRestore</var> is set to False then the
		<var>Restore</var> and <var>Save</var> methods must be called from the host
		application.
	</li>

	<li>
		The <var>Options</var> property can be used to customise the way the
		window is restored as follows:

		<ul class="unspaced">

			<li class="first">
				The components can be instructed to ignore the saved window
				state &ndash; the window is then displayed in the normal state.
			</li>

			<li>
				The window's saved size can be ignored and the default size of
				the form used instead. This is useful for dialog boxes and fixed
				size windows.
			</li>

			<li>
				The window can be kept within the current work area of the
				desktop.
			</li>

		</ul>

	</li>

	<li>
		When the form is to be restored in a minimized state it briefly appears
		on screen in the normal state before being minimized. The
		<var>MinimizeDelay</var> property controls the delay between the window
		appearing and being minimized.
	</li>
	
</ul>

<p>
	<var>TPJWdwState</var> and <var>TPJRegWdwState</var> also support the
	<var>OnReadWdwState</var> event. Handling this event enables the stored
	window's state, size and position values before the window is restored. This
	event is called after reading the data and before sizing the window.
	<var>TPJUserWdwState</var> does not expose this event because the user is in
	charge of reading the data and can therefore modify it in the
	<var>OnReadData</var> event.
</p>

</ul>

<p>
	Other features include:
</p>

<ul class="spaced">

	<li>
		A help file that integrates into the Delphi 3 to 7 IDE. The help file
		does not integrate with Delphi 2005 and later but can be used, with some
		loss of functionality, independently of the IDE.
	</li>

	<li>
		A property editor is provided for editing the <var>RootKey</var>
		property of <var>TPJRegWdwState</var>. This editor is also available
		<a href="http://www.delphidabbler.com/software?id=hkeype">
		separately</a>.
	</li>

</ul>

<div class="pullout">
	<strong>Note:</strong> You can see a more detailed description of the
	components on the
	<a href="http://www.delphidabbler.com/software?id=wdwstate">Window State
	Components</a> web page.
</div>


<p class="gototop">
	&raquo; <a href="#contents">Contents</a>
</p>

<h2 id="compatibility">
   Compatibility
</h2>

<p>
	The Window State Components compile with Delphi 3 and later. They have been
	tested with Delphi 3, 4, 6, 7 and 2006. The property editor can be used with
	any of the compilers supported by the components.
</p>


<p class="gototop">
	&raquo; <a href="#contents">Contents</a>
</p>

<h2 id="installation">
	Installation
</h2>

<p>
	The Window State Components, their documentation and demo programs are
	supplied in a zip file. Before installing you need to extract all the files
	from the zip file, preserving the directory structure. The following files
	will be extracted:
</p>

<ul>

	<li class="first">
		<strong><code>PJWdwState.pas</code></strong> &ndash; component source
		code.
	</li>

	<li>
		<strong><code>PJWdwState.dcr</code></strong> &ndash; resource file
		containing component palette glyphs.
	</li>

	<li>
		<code>PJWdwState.hlp</code> &ndash; component help file that integrates
		with the Delphi 3 to 7 OpenHelp system.
	</li>

	<li>
		<code>PJWdwState.als</code> &ndash; a-link keyword file for integration
		with the Delphi 6 or 7 OpenHelp system.
	</li>

	<li>
		<strong><code>PJHKEYPropEdit.pas</code></strong> &ndash; HKEY property
		editor.
	</li>

	<li>
		<code>ReadMe.htm</code> &ndash; this file.
	</li>

⌨️ 快捷键说明

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