AddressBar with TProgressBar as background.. : Delphi
This is a discussion on AddressBar with TProgressBar as background.. within the Delphi forums in Programming Languages category; Jamie Dale wrote: > Hi > > I saw a snippet of the iPhone on TV today. > > The internet address bar was very nice. As the page was loading, the > ProgressBar was actually the white background of the addressbar! Have you ever used the search tool in Windows Vista's Explorer? That does the same. The path combobox is underlayed with a progress bar. http://rvelthuis.de/images/progress-address-bar.png -- Rudy Velthuis [TeamB] "The music business is a cruel and shallow money trench, a long plastic hallway where thieves and pimps run free, and good men die like dogs. There's also a ...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| > Hi > > I saw a snippet of the iPhone on TV today. > > The internet address bar was very nice. As the page was loading, the > ProgressBar was actually the white background of the addressbar! Have you ever used the search tool in Windows Vista's Explorer? That does the same. The path combobox is underlayed with a progress bar. http://rvelthuis.de/images/progress-address-bar.png -- Rudy Velthuis [TeamB] "The music business is a cruel and shallow money trench, a long plastic hallway where thieves and pimps run free, and good men die like dogs. There's also a negative side". -- Hunter S. Thompson |
|
#2
| |||
| |||
| Hi I saw a snippet of the iPhone on TV today. The internet address bar was very nice. As the page was loading, the ProgressBar was actually the white background of the addressbar! As the progress was made, a semi transparent blue line grew from left to right along the addy bar. Now, can anyone tell me how I could duplicate this using D6??? Thx guys n gals! JD |
|
#3
| |||
| |||
| "Jamie Dale" <jamie.dale@yahoo.com> wrote in message news:474df334$1@newsgroups.borland.com... > Now, can anyone tell me how I could duplicate this using D6??? On versions of Windows later then Win95, you can subclass an edit control to intercept the WM_CTLCOLOREDIT message (for TEdit, it would be CN_CTLCOLOREDIT instead) and return a brush that is created from a bitmap. You can then draw a bitmap of whatever type of progress display you want. Here is a simple example: TForm1 = class(TForm) published Edit1: TEdit; Timer1: TTimer; procedure FormCreate(Sender: TObject) procedure Timer1Timer(Sender: TObject); private OldWndProc: TWndMethod; procedure EditWndProc(var Message: TMessage); end; procedure TForm1.FormCreate(Sender: TObject); begin OldWndProc := Edit1.WindowProc; Edit1.WindowProc := EditWndProc; end; procedure TForm1.EditWndProc(var Message: TMessage); var bmp: TBitmap; r: TRect; oldRight: Integer; begin if Message.Msg = CN_CTLCOLOREDIT then begin Windows.SetTextColor(Message.WParam, ColorToRGB(Edit1.Font.Color)); Window.SetBkMode(Message.WParam, TRANSPARENT); bmp := TBitmap.Create; try r := Edit1.ClientRect; bmp.Width := (r.Right - r.Left); bmp.Height := (r.Bottom - r.Top); if Edit1.Tag > 0 then begin oldRight := r.Right; r.Right := r.Left + ((r.Right - r.Left) * (Extended(Edit1->Tag) / 100); bmp.Canvas.Brush.Color := clAqua; bmp.Canvas.FillRect(r); r.Left := r.Right; r.Right := oldRight; end; bmp.Canvas.Brush.Color := Edit1.Color; bmp.Canvas.FillRect(r); Message.Result := Windows.CreatePatternBrush(bmp.Handle); finally bmp.Free; end; Exit; end; OldWndProc(Message); end; procedure TForm1.Timer1Timer(Sender: TObject); begin // I set Timer1.Interval to 50ms... if Edit1.Tag >= 100 then Edit1.Tag := 0 else Edit1.Tag := Edit1.Tag + 1; Edit1.Invalidate; end; Gambit |
|
#4
| |||
| |||
| Hi Rudy, No I wasn't aware of that (I've not touched Vista and tbh I'm not keen on doing so either!). Very nice screenshot though!. Despite not liking Vista for it's technical stuff, I do think M$ put a nice graphical system together for it - even it if it rather heavy on resources (from what I've heard). Is there a skin like this for XP? JD "Rudy Velthuis [TeamB]" <newsgroups@rvelthuis.de> wrote in message news:xn0fe99tkfknaf3035@newsgroups.borland.com... > Jamie Dale wrote: > >> Hi >> >> I saw a snippet of the iPhone on TV today. >> >> The internet address bar was very nice. As the page was loading, the >> ProgressBar was actually the white background of the addressbar! > > Have you ever used the search tool in Windows Vista's Explorer? That > does the same. The path combobox is underlayed with a progress bar. > > http://rvelthuis.de/images/progress-address-bar.png > > -- > Rudy Velthuis [TeamB] > > "The music business is a cruel and shallow money trench, a long > plastic hallway where thieves and pimps run free, and good men > die like dogs. There's also a negative side". > -- Hunter S. Thompson |
|
#5
| |||
| |||
| Remy, As always, your the man! Thanks for that, I'll save the code onto the laptop and give it a spin during my lunch today! Cheers JD "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:474e1291@newsgroups.borland.com... > > "Jamie Dale" <jamie.dale@yahoo.com> wrote in message > news:474df334$1@newsgroups.borland.com... > >> Now, can anyone tell me how I could duplicate this using D6??? > > On versions of Windows later then Win95, you can subclass an edit control > to intercept the WM_CTLCOLOREDIT message (for TEdit, it would be > CN_CTLCOLOREDIT instead) and return a brush that is created from a bitmap. > You can then draw a bitmap of whatever type of progress display you want. > Here is a simple example: > > TForm1 = class(TForm) > published > Edit1: TEdit; > Timer1: TTimer; > procedure FormCreate(Sender: TObject) > procedure Timer1Timer(Sender: TObject); > private > OldWndProc: TWndMethod; > procedure EditWndProc(var Message: TMessage); > end; > > procedure TForm1.FormCreate(Sender: TObject); > begin > OldWndProc := Edit1.WindowProc; > Edit1.WindowProc := EditWndProc; > end; > > procedure TForm1.EditWndProc(var Message: TMessage); > var > bmp: TBitmap; > r: TRect; > oldRight: Integer; > begin > if Message.Msg = CN_CTLCOLOREDIT then > begin > Windows.SetTextColor(Message.WParam, > ColorToRGB(Edit1.Font.Color)); > Window.SetBkMode(Message.WParam, TRANSPARENT); > > bmp := TBitmap.Create; > try > r := Edit1.ClientRect; > bmp.Width := (r.Right - r.Left); > bmp.Height := (r.Bottom - r.Top); > > if Edit1.Tag > 0 then > begin > oldRight := r.Right; > r.Right := r.Left + ((r.Right - r.Left) * > (Extended(Edit1->Tag) / 100); > > bmp.Canvas.Brush.Color := clAqua; > bmp.Canvas.FillRect(r); > > r.Left := r.Right; > r.Right := oldRight; > end; > > bmp.Canvas.Brush.Color := Edit1.Color; > bmp.Canvas.FillRect(r); > > Message.Result := Windows.CreatePatternBrush(bmp.Handle); > finally > bmp.Free; > end; > > Exit; > end; > > OldWndProc(Message); > end; > > procedure TForm1.Timer1Timer(Sender: TObject); > begin > // I set Timer1.Interval to 50ms... > > if Edit1.Tag >= 100 then > Edit1.Tag := 0 > else > Edit1.Tag := Edit1.Tag + 1; > > Edit1.Invalidate; > end; > > > Gambit > |
|
#6
| |||
| |||
| Jamie Dale wrote: > Is there a skin like this for XP? I have no idea. I never use skins. -- Rudy Velthuis [TeamB] "The bureaucracy is expanding to meet the needs of an expanding bureaucracy." -- Unknown |
|
#7
| |||
| |||
| Jamie, | Is there a skin like this for XP? Take a look at VCLskin. http://www.link-rank.com/ -- Q 11/29/2007 10:43:15 XanaNews Version 1.17.5.7 [Q's salutation mod] |

