Skip to content
This repository was archived by the owner on May 14, 2023. It is now read-only.

Replace cbview pages with redirects #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions Docs/CBView.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
# Clipboard Viewer Component

## Introduction

This is the home page for the on-line documentation of the DelphiDabbler [Clipboard Viewer Component](https://delphidabbler.com/software/cbview).

The Clipboard Viewer component is a non-visual Delphi component notifies the user when the content of the Windows clipboard changes.

This is a Windows-only, 32 and 64 bit compatible, component that requires the VCL. It is not compatible with FireMonkey.

## Contents

* [Overview](./CBView/Overview.md)
* [Programmers' Guide](./CBView/API.md)
* [Example](./CBView/Example.md)

## Links

* Back to [Documentation Home Page](Welcome.md)
* [Clipboard Viewer Component web page](https://delphidabbler.com/software/cbview).
* [Downloads](https://sourceforge.net/projects/ddablib/files/cbview/) -- Download current version here.
* [Source code](https://github.com/ddablib/cbview) -- Current development tree.
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/).
37 changes: 1 addition & 36 deletions Docs/CBView/API.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
# [Clipboard Viewer Component](../CBView.md) Programmers' Guide

## Introduction

This section of the _Clipboard Component Component_ documentation focusses on describing the usage of components's code.

> **This documentation refers to v2.0 or later of the component only.**
>
> v1 is no longer supported and no documentation is available.

## Contents

There is just one unit in this project, named _PJCBView_, that contains all the code.

_PJCBView_ contains just a single component: [_TPJCBViewer_](./API/TPJCBViewer.md).

## Conventions

Identifiers in plain text appear like this: _Identifier_

Identifiers in links appear like this: [_Identifier_](#conventions)

Values and in-line code appear like this:

* `42`
* `'text'`
* `X := 42;`

Declarations and source code examples appear syntax highlighted like this:

```pascal
procedure Foo(const Bar: string);
```

## Links

* [Overview](./Overview.md)
* [Example](./Example.md)
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/API.html).
18 changes: 1 addition & 17 deletions Docs/CBView/API/TPJCBViewer-Enabled.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# Enabled property

**Project:** [Clipboard Viewer Component](../../CBView.md)

**Unit:** _PJCBView_

**Class:** [_TPJCBViewer_](./TPJCBViewer.md)

```pascal
property Enabled: Boolean;
```

## Description

The _Enabled_ property enables and disables the component.

When the property is set to _False_ the component will never trigger the [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) event. Restoring _Enabled_ to _True_ re-enables [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md).

The default value is _True_.
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/API/TPJCBViewer-Enabled.html).
16 changes: 1 addition & 15 deletions Docs/CBView/API/TPJCBViewer-OnClipboardChanged.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# OnClipboardChanged event

**Project:** [Clipboard Viewer Component](../../CBView.md)

**Unit:** _PJCBView_

**Class:** [_TPJCBViewer_](./TPJCBViewer.md)

```pascal
property OnClipboardChanged: TNotifyEvent;
```

## Description

This event is triggered when the clipboard contents change, providing that the [_Enabled_](./TPJCBViewer-Enabled.md) property is _True_. You should handle this event to perform any processing you need to do when the clipboard content changes.

If both the [_TriggerOnCreation_](./TPJCBViewer-TriggerOnCreation.md) and [_Enabled_](./TPJCBViewer-Enabled.md) properties are _True_ then the event is also fired immediately after the component is created. This behaviour can be useful when you need to check the clipboard content at program start up as well as when the content changes. By using this feature you simply need to code the event handler and don't need any special start up code.
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/API/TPJCBViewer-OnClipboardChanged.html).
25 changes: 1 addition & 24 deletions Docs/CBView/API/TPJCBViewer-TriggerOnCreation.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
# TriggerOnCreation property

**Project:** [Clipboard Viewer Component](../../CBView.md)

**Unit:** _PJCBView_

**Class:** [_TPJCBViewer_](./TPJCBViewer.md)

```pascal
property TriggerOnCreation: Boolean;
```

## Description

This property controls whether a clipboard change event is triggered when the component is created.

When _TriggerOnCreation_ is _True_ the [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) event is triggered immediately after the component is created, regardless of whether the clipboard has changed. This behaviour is useful because you often need to check the clipboard content at program start up as well as when the content changes. By using this feature you simply need to code the event handler and don't need any special start up code.

When the property is _False_ the [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) event is only triggered when the content of the clipboard actually changes.

## Notes

* This is a design-time only property. Setting it dynamically at run time will have no effect since the component will have been initialised before the user gets a chance to change the property's value.
* This property has no effect if [_Enabled_](./TPJCBViewer-Enabled.md) is set to _False_ at design time. In this case no event is fired after component creation, even if _TriggerOnCreation_ is _True_.

The default value is _True_.
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/API/TPJCBViewer-TriggerOnCreation.html).
27 changes: 1 addition & 26 deletions Docs/CBView/API/TPJCBViewer.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# TPJCBViewer class

**Project:** [Clipboard Viewer Component](../../CBView.md)

**Unit:** _PJCBView_

_TPJCBViewer_ notifies the user of changes to the Windows clipboard. It registers itself with Windows to receive notifications whenever the contents of the clipboard change. When a change is detected the [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) event is triggered. Users handle this event.

The component also provides an [_Enabled_](./TPJCBViewer-Enabled.md) property which, when _False_, prevents [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) events from being triggered. It also has a [_TriggerOnCreation_](./TPJCBViewer-TriggerOnCreation.md) property which, when _True_, causes the [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) event to be triggered immediately after the control has been created as well as when the clipboard contents change.

## Methods

_TPJCBViewer_ defines no new methods.

## Properties

| Property | Description |
|----------|-------------|
| [_Enabled_](./TPJCBViewer-Enabled.md) | Enables and disables the component. |
| _Name_ | Inherited from _TComponent_. See Delphi help for details. |
| _Tag_ | Inherited from _TComponent_. See Delphi help for details. |
| [_TriggerOnCreation_](./TPJCBViewer-TriggerOnCreation.md) | Causes a clipboard change event to be triggered when the component is created. |

## Events

| Event | Description |
|-------|-------------|
| [_OnClipboardChanged_](./TPJCBViewer-OnClipboardChanged.md) | Event triggered when the clipboard contents change. |
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/API/TPJCBViewer.html).
35 changes: 1 addition & 34 deletions Docs/CBView/Example.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
# [Clipboard Viewer Component](../CBView.md) Example

The following is an example of how to use the [Clipboard Viewer Component](./Overview.md).

Drop a [_TPJCBViewer_](./API/TPJCBViewer.md) component, a _TButton_ and a _TMemo_ on a form. Do not change any of the components' default properties. Add the _Clipbrd_ unit to your uses clause. Using the object inspector, create the following event handlers:

* an [_OnClipboardChanged_](./API/TPJCBViewer-OnClipboardChanged.md) handler for the [_TPJCBViewer_](./API/TPJCBViewer.md) component;
* an _OnClick_ handler for the _TButton_.

Implement the event handlers as follows:

```pascal
procedure TForm1.PJCBViewer1ClipboardChanged(Sender: TObject);
begin
// Clipboard has changed - emit beep and decide whether to enable button
// (only if text is on clipboard)
MessageBeep(0);
Button1.Enabled := ClipBoard.HasFormat(CF_TEXT);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
// We assume this button can only be clicked when there is text on clipboard,
// so it is safe to display the text
Memo1.Text := ClipBoard.AsText;
end;
```

Because [_TPJCBViewer_](./API/TPJCBViewer.md)'s [_TriggerOnCreation_](./API/TPJCBViewer-TriggerOnCreation.md) property is _True_ by default, an [_OnClipboardChanged_](./API/TPJCBViewer-OnClipboardChanged.md) event is triggered as the program starts. The beep that is generated by the event handler proves this.

The button is enabled only if the clipboard contains text and becomes greyed out when the clipboard doesn't contain text. Clicking the button displays the clipboard text in the memo. Whenever the clipboard's contents change a beep is emitted.

**Links:**

* [Overview](./Overview.md)
* [Programmers' Guide](./API.md) -- Classes, methods, properties etc.
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/Example.html).
13 changes: 1 addition & 12 deletions Docs/CBView/Overview.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# [Clipboard Viewer Component](../CBView.md) Overview

> This page provides an overview of the features of the Clipboard Viewer Component. If you are looking for information on programming with the component please see the [Programmers' Guide](./API.md).

This project provides a single non-visual component that notifies the user when the content of the Windows clipboard changes. This is done by triggering an event.

On versions of Windows that support it the newer clipboard format listener API is used to monitor the clipboard. On older versions of Windows the older, and less reliable, clipboard viewer API is used instead.

> Thanks to _Mason Wheeler_ for providing the more reliable clipboard listener code.

## Links

* [Programmers' Guide](./API.md) -- Classes, methods, properties etc.
* [Example](./Example.md)
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/2/Overview.html).
2 changes: 1 addition & 1 deletion Docs/ClipboardViewerComponent.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Clipboard Viewer Component #

This page has [**moved**](./CBView.md).
This page has [**moved**](https://lib-docs.delphidabbler.com/CBView/).