ClipCub
Delphi juli 26th, 2008What is ClipCub?
ClipCub is a utility for the Windows clipboard. The standard Windows clipboard stores the last item only, but ClipCub stores all recent clipboard items. This enables you to go back to a previous clipboard entry. ClipCub is an entry for the Darwin Race of Languages programming contest.
Download ClipCub
You can download the latest version here:
ClipCub 0.9.0.1 Setup.exe
Screenshots
Main screen:

Settings:

juli 29th, 2008 at 23:19
I downloaded your ClipClub amd have been working to improve it a little. So far I added a viewer to allow viewing full size clipboard images in a TImage and text in a TMemo. It seems to be working quite well.
I may replace the TImage with ImageEN eventually so there will be even more capability…
I am compiling in Delphi 2007 Win32 so I was wondering if you know how I can remove XPMan from the project file and replace it with enable runtime themes from program options in the Delphi IDE? I can not manage to get the ide checkbox enabled in Delphi regardless of what I try in the project file.
If you are interested I’ll send you my source when I finish it.
Nice job on Clip Club…
Regards,
Bill
juli 30th, 2008 at 11:03
[…] who came in first and second place with their awesome applications (Command Line GUI - GBAK and ClipCub […]
juli 30th, 2008 at 12:53
Cool!
juli 30th, 2008 at 16:37
The clipboard viewer is proceeding nicely.
I finally enabled runtime themes from program options by creating a new main form in Delphi 2007 Win32.
Right now it can be attached to the main form and move with it when the form moves. The clipboard viewer can also be unlocked from the main form so it can be moved to a new position.
The clipboard viewer form detects changes in clipboard content automatically and displays text or images. double clicking a clipitem displays the entire text or image in the clipboard.
Screen capture menu items for capturing images of the screen, selection, active window, object, icon or polygon selection were added using my Apprehend component. Since clip cub sets in the tray the screen capture is a nice feature to have along with the clips.
I modified TClipboardBitmapData.AfterLoad to handle FBitmap.PixelFormat = pfDevice:
procedure TClipboardBitmapData.AfterLoad;
const
BitCounts: array[ pf1Bit..pf32Bit ] of Byte = ( 1, 4, 8, 16, 16, 24, 32 );
begin
inherited AfterLoad;
// w2m handle pfdevice
if FBitmap.PixelFormat = pfDevice then begin
FBitmap.PixelFormat := pf24Bit;
FComment := Format( ‘%d x %d, %d bits (%s)’, [
FBitmap.Width,
FBitmap.Height,
BitCounts[ FBitmap.PixelFormat ],
FileSizeToString( ( FBitmap.Width * FBitmap.Height * 24 ) div 8 )
] );
end
else
// w2m handle pfdevice
FComment := Format( ‘%d x %d, %d bits (%s)’, [
FBitmap.Width,
FBitmap.Height,
BitCounts[ FBitmap.PixelFormat ],
FileSizeToString( ( FBitmap.Width * FBitmap.Height * BitCounts[ FBitmap.PixelFormat ] ) div 8 )
] );
end;
Double clicking a clipitem sets selected and active to true, then displays the clipboard contents in the clipboard viewer.
A statusbar was also added to the main form to show the number of clips and selected clip number.
Regards,
Bill
juli 30th, 2008 at 17:44
Hi Bill,
Nice to see you that you are improving ClipCub. An inspection pane was on my whishlist too. Theming support for both D2006 and D2007 could be achieved by manually including a manifest resource. I already have that… somewhere.
Btw, the design of the viewer is far from perfect. It should not need any knowledge of the ClipboardManager and that’s not the case right now. Improvement is on my list.
Some busy days ahead, but I would love to see your improvements with source.
Regards,
Jan Wicher
juli 30th, 2008 at 20:02
Bravo! Cool program. I don’t know if Bill Miller can share the modified sources (with the screen capture utility)? If so here my email: rpoulin /AT/ laposte.net
Thanks.
juli 30th, 2008 at 20:19
Sure I’d be glad to send you my improvements… Right now I am adding sending html to the clipboard. Then finally I’d like to try to save HTML syntax color highlited delphi code to the clipboard as an image.
I switched my plain TMemo for text to SynEdit for syntax highlighting… now how to convert text into an image…. that may be dificult… any ideas?
Regards,
Bill
juli 30th, 2008 at 21:25
Thank you - Using Apprehend (CaptureSpecificRect), you could grab the memo with some fixed dimensions (or exact dimensions of the memo control) and take a picture. ?
juli 31st, 2008 at 08:25
Thanks Rap… I thought of that, but I wanted something better. There are a couple of HTMLToImage components but they cost $150 and they are ActiveX which I hate… so I experimented with ThtmlViewer by D. Baldwin and he has a couple of methods to create bitmaps and metafiles from HTML. I have the Bitmaps working quite well, but so far the Metafile is causing me problems. Hopefully I’ll get that figured out too.
I bring the html into SynEdit… Syntax fortmat it for Delphi, load it into ThtmlViewer. When you send the html from ThtmlViewer to the clipboard it pops into ImageEN as a nice looking bitmap. Amasingly this all ocurs almost instantly!
I switched from using TImage in ClipCub… To ImageEn because it has nice zooming, selection and cropping and is alot easier to deal with than TImage….
Bill
juli 31st, 2008 at 13:03
Now I’m wondering Bill.. Who or what could be in need of an “html syntax color highlited delphi code (…) as an image”? If you are using the image for preview only, you could as well use the THtmlViewer component for preview.
juli 31st, 2008 at 14:21
For posting Delphi code to webpages as an image is all. Maybe it is not needed? I am not an html expert at all.
juli 31st, 2008 at 22:55
My two cents… Bill is creating a mix of ClipCub and some sort of ScreenGrab_ing technics. I have never seen syntax highlighte screen capture facilities - it may be a good idea but footprint will kind of large?
augustus 2nd, 2008 at 03:28
The exe will be larger (4.77 mb) with the viewer and screen capture. Only ASGCapture was added to the main form but peformance and speed are not affected.
It takes awhile to load with a number of large images in the xml… so a splash screen was added so that the user will know when the main form is active… which also adds a little to the exe size. The seperate viewer form uses
// 3rd Party
PngImageList,
ieview,
imageenview,
JvExStdCtrls,
JvCombobox,
JvColorCombo,
Htmlview,
SynEdit,
SynEditHighlighter,
SynHighlighterPas,
SynEditExport,
SynExportHTML,
SynHighlighterDfm,
SynHighlighterXML,
SynHighlighterBat,
SynHighlighterInno,
SynHighlighterIni,
SynHighlighterHtml,
SynHighlighterGeneral;
I also created an alternate version that uses DeveloperExpress Expressbars for the toolbars and the viewer was put in a Expressbars docked window in the main form. Personally do not like developing with actions and coolbars so the alternate has an slightly improved interface. The DeveloperExpress version’s exe is 7 mb plus I currently have Eureka log turned on with full debug enabled. The later version uses these 3 third party units:
// 3rd Party
PngImageList,
ASGCapture, // screen capture
dxDockControl, // DevEx
dxDockPanel, // DevEx
dxBar, // DevEx
dxBarExtItems, // DevEx
cxClasses, // DevEx
cxLookAndFeels, // DevEx
IEView, // TImage replacement
ImageENView, // TImage replacement image viewer
HtmlView, // HTML Viewer (open source)
SynEdit, // Text Editor (open source) text viewer
SynHighlighterIni, (open source) syntax parsing
SynHighlighterHtml, (open source) syntax parsing
SynHighlighterGeneral, (open source) syntax parsing
SynHighlighterXML, (open source) syntax parsing
SynHighlighterBat, (open source) syntax parsing
SynHighlighterInno, (open source) syntax parsing
SynEditExport, (open source) Export to HTML)
SynExportHTML, (open source) Export to HTML)
SynHighlighterPas, (open source) syntax parsing
SynEditHighlighter, (open source) syntax parsing
SynHighlighterDfm; (open source) syntax parsing
When I get both apps running to my liking I’ll share the source. Let me know which one you want…. the plain vcl interface or Expressbars.
Bill
augustus 18th, 2008 at 15:04
Jan:
I created a component to display the clipboard contents. It uses TSynEdit for text and and TImage for pictures.
However it can display pascal syntax formatted clipboard text in SynEdit. It achieves this by looking the the first word of the clipboard text and if it matches delphi keywords it is displayed with the delphisyntaxformatter.
It is a lot simplier than I planned and does not display rtf or html.
It detects clipboard changes using your clipboardListenerClasses.
If you wish to look at it let me know and I’ll send you a copy of it. Thwere is a runtime (no install required) and a designtime (install required) demo. Please advise where you want it to be emailed to.
Bill
augustus 26th, 2008 at 22:38
Bill, I would love to see your code. I’m in the middle of a move and I probably wont look at your code for the rest of the week. But please send it to me: janwicher -at- live -dot- nl
september 1st, 2008 at 13:14
Jan,
Did you get my email?
Bill
september 1st, 2008 at 19:34
Hi Bill, got it. Just moved and my internet connection is working again. The only thing I need is some serious rest now
I downloaded the required 3rd party components and the source compiles with D2006 with minor changes only. I’ll contact you via email.
september 2nd, 2008 at 22:01
Hi Jan,
I just emailed you a viewer component update along with a Expressbars version of ClipCub with the viewer.
Bill
september 2nd, 2008 at 23:29
Hi Jan,
Well my final task for today was I added export to RTF and export to HTML to the viewer. It only took about 20 lines of code…. I opened the rtf file in Microsoft word… perfectly formated pascal source code… I opened the HTML file in Internet Explorer… perfectly formated pascal source code…
I guess this could be used to quickly paste some code into a web page…
Bill