Monthly Archives: January 2010

Alternative progressbar

Showing Vista Progress Bar

I guess most of you have allready found a replacement for default progressbar in D2007. If not take a look at my solution. It have similar look to the system progressbar but without any animation.

The component will work in any delphi version but I have only tested it in D2007 and D2010.

It is licensed as freeware so no limitations on its use except you can not charge for it.

Download VistaProBar

Small but smart colorpicker

Small but smart colorpicker

The small but smart color picker

This is my attempt at making a small but smart color picker. It has two modes and can be used for live color updating. The mode shown in image is Alphamode:= True, second mode will then be Alphamode:= False which will be more aimed at web design.

To set the colorpickers color use:
SetColor(Color, Alpha, Update) or SetColor(Color, Update) where Update is a boolean which if false will set old color to color value.

Alpha is a value between 0 and 255.

To get color value use GetColor. Alpha value is stored in RGBAlpha.

Download: Color Picker (260kB)

Released rkSmartPath version 2

Smart Path v2 in action

Smart path demo application

After a lot of testing, tweaking and fixing version 2 of rkSmartPath is available.
Whats new:

* Now it is possible to disable edit of path
* Added owner draw event
* Using displayname for folders
* Added search event. Use path edit for searching/filtering
* Tweaks and fixes
* End arrow only if there is folders in last folder

What is rkSmartPath: it is a component for Delphi that will allow you to navigate the filesystem similar to explorer in Vista. Folder path is represented as buttons and arrows. Pressing a button will allow you to set that path, pressing an arrow will let you pick a folder in that folder. Try the demo and you see what I am talking about.

Download Project(265kB)

Update 03.02.2010:

TBXSmartPath

How it looks with Athen theme

Download TBX test version

Mixing two colors

Just a quick tips for those of you needing to blend two colors. Usage is very easy.

// Usage  NewColor:= Blend(Color1, Color2, blending level 0 to 100);
function Blend(Color1, Color2: TColor; A: Byte): TColor;
var
  c1, c2: LongInt;
  r, g, b, v1, v2: byte;
begin
  A:= Round(2.55 * A);
  c1 := ColorToRGB(Color1);
  c2 := ColorToRGB(Color2);
  v1:= Byte(c1);
  v2:= Byte(c2);
  r:= A * (v1 - v2) shr 8 + v2;
  v1:= Byte(c1 shr 8);
  v2:= Byte(c2 shr 8);
  g:= A * (v1 - v2) shr 8 + v2;
  v1:= Byte(c1 shr 16);
  v2:= Byte(c2 shr 16);
  b:= A * (v1 - v2) shr 8 + v2;
  Result := (b shl 16) + (g shl 8) + r;
end;