Solved

ComboBox with a TTreeView

Posted on 1998-09-11
30
506 Views
Last Modified: 2012-05-04
I need a combo box like the one in the Win95 style Open and Save dialogs, but I need to descide what to put in them.  For example, at times I will need it to display the following when dropped down:
(Icon) All Journals
       (Icon) General Journal
              (Icon) Add
              (Icon) Edit
       (Icon) U.S. Cash Disbursements
              (Icon) Add
   etc................

There will be the one Level 0 item (All Journals), Six level 2 items (the names of each Journal) and up to 3 level 3 items for each level 2 item.  The Level 3 items are decided upon as the user continues.  EG  Edit will only be accessible if they have entered edit mode on a transaction but otherwise, it will not display.  

Therefore, I need the code on how to do this or a component that will do this.  

COMBO BOX THAT WILL POP DOWN A TTREEVIEW WOULD BE APPROPRIATE.

Thanks,
Scott

0
Comment
Question by:millerw
  • 13
  • 11
  • 4
  • +2
30 Comments
 
LVL 1

Author Comment

by:millerw
ID: 1339429
BTW, freeware please :-)
 Scott
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339430
It's not a drop-down tree view - it's just a simple ownerdraw combo I think.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1339431
Hi millerw,

just like erajoj already said on another question (smart thinking that guy, didn't thought on this myself) , what about :

Use a TComboEdit from RXLib and inherit it with a TTreeView as
a member.

You MUST get RxLib at (IT's GREAT and FREEWARE!!) :
 http://rx.demo.ru/

Regards, Zif.
0
 
LVL 5

Expert Comment

by:inter
ID: 1339432
Hi boys,
There may be another way as follows:
Just place a combo box on your form and when it is about to be opened create (or show a hidden) tree view just down to the box...and when user selects(i.e. on treeview1.change event) get the selected caption and place to the combo and close(hide that tree view)...
regards, igor
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339433
Igor, that's what I did when I was woking on VB ;-)
I want to beleive that there is a more "Delphi" solution for this...

0
 
LVL 10

Expert Comment

by:Lischke
ID: 1339434
That's what the new COMBOBOXEX class is for. It accepts an icon as well as an indentation level on user request for each item in the drop down list. There's a shareware implementation for TComboBoxEx on DSP.

Ciao, Mike
0
 
LVL 1

Author Comment

by:millerw
ID: 1339435
I searched the entire web from Alta Vista for "+combobox +tree" and came up with over 1000 hits.  I went down the list and found a DSP link to a zip called "mwcombo.zip."  It is freeware and it appears to do everything I need.  You should all check it out (ZifNab has the right idea it looks like).  It is a template combobox that you make a decendant of to get a treeview/listview/etc. to appear under it.  I'm still reading through the code and looking at everything, but it appears to be working.

Matvey:  You are correct.  That is how Windows/Explorer does it.  However, they have these really nice API calls to do it automatically (I've spent several hours looking for a "nice" solution in the Windows API helpfile).  Also, I'm not very good at ownerdrawn controls.  If I were to attempt that, I'd need help--I'm under a major crunch to get this done by Tuesday (Flying out to Germany for a field beta test and the in house testers need it to test before we leave).

ZifNab:  That is what the above component does.  I have RXLib.  Any more info?  I'm pretty sure I could do it, but as I've said..time is of the essence.

Inter:  Your solution will work for many cases, but not for all.  One such case is if you are using Aligning.  I have found that the solution you have stated will shift around any aligned controls (eg alClient does really weird things).  This is very visible in design mode if you want to try it.  That was my first idea before I posted this question.  The only way I can think of is to change the parent/owner of the TTreeview or make it draw "inside" the dropdown "window" and make it a child of that window---haven't been able to "request" a handle to the drop down window though (its not as easy as reqesting the edit box of a listview :-).  

Lischke:  Thanks for the info, but freeware only please.

Thanks for the time,
Scott
0
 
LVL 1

Author Comment

by:millerw
ID: 1339436
Adjusted points to 200
0
 
LVL 1

Author Comment

by:millerw
ID: 1339437
Matvey:

I don't know what I was thinking.  I was tired Friday and missed all the OwnerDraw stuff for comboboxes.  Yes, I have worked with the grids in this way and I will probabaly do it this way in the end.  Right now, pretty doesn't count--a functional version is my main goal.  If I use your idea instead of the components I found, I'll give you the points.

Scott
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339438
I can send you an example of an ownerdraw listbox. It must be alike for a combo, though my first attempt wasn't successful.
So tell me if you want that example...

Good luck,
bosism@netvision.net.il
0
 
LVL 1

Author Comment

by:millerw
ID: 1339439
Yeah, send it on.

Scott.Miller@imb.org
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339440
Sure, update us with the progress please...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1339441
hi millerw, sorry for not responding... but I was away for a while... I guess you don't need it anymore... hope you could get it to work. Zif.
0
 
LVL 1

Author Comment

by:millerw
ID: 1339442
Ok, Matvey, I'm using your technique, but your going to have to earn those 200 points (either that or I will delete this and make another to give you less).  

Here is what you have to do.  The below code does what I need.  There are two problems.  First, I need to draw the actual text in the ComboBox (not the drop down) differently than the drop down text.  EG.  When Add under General Journal is selected, the combo box should read "Adding to General Journal" etc.  Not the same drawing as is shown in the list.  Second, I need to have the marquee select only the blue region around the text.  You will see what I mean when you pop down the list and move the cursor around.

If you have any questions, let me know,
Scott

0
 
LVL 1

Author Comment

by:millerw
ID: 1339443
--Begin Pasted Code--
unit MainForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    iltJournal: TImageList;
    ComboBox1: TComboBox;
    ImageList1: TImageList;
    procedure ComboBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
  private
    { Private declarations }
    function GetCaps (Str : String) : String;
    function JournalMode (Index : Integer): Integer;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

function TForm1.GetCaps (Str : String) : String;
var
   Index : Integer;
begin
     Result := '';
     For Index := 1 to Length (Str) do
         If Str[Index] in ['A'..'Z'] then
            Result := Result + Str[Index];
end;

function TForm1.JournalMode (Index : Integer): Integer;
var
   JMode : String;
begin
     Result := 0;
     JMode := GetCaps(ComboBox1.Items[Index]);
     If Length(JMode) = 1 then
        Case JMode[1] of
        'A' : Result := 1;
        'E' : Result := 2;
        'U' : Result := 3;
        end;
     While Length(JMode) = 1 do
     begin
          Index := Index - 1;
          JMode := GetCaps(ComboBox1.Items[Index]);
     end;
     If (JMode <> '') then
        Case JMode[1] of
        'G' : Result := Result + 10;
        'U' : Case JMode[4] of
              'R' : Result := Result + 20;
              'D' : Result := Result + 30;
              end;
        'C' : Result := Result + 40;
        'L' : Case JMode[4] of
              'R' : Result := Result + 50;
              'D' : Result := Result + 60;
              end;
        end;
end;

procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
   TmpColor : TColor;
begin
     With Control as TComboBox do
     begin
          TmpColor := Canvas.Brush.Color;
          Canvas.Brush.Color := clWindow;
          Canvas.FillRect(Rect);
          Canvas.Brush.Color := TmpColor;
{          If odFocused in State then
             iltJournal.DrawingStyle := dsFocus
          else
              iltJournal.DrawingStyle := dsNormal;}
          If (JournalMode(Index) mod 10) <> 0 then
          begin
               If (JournalMode(Index) div 10) <> 6 then
                  ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 0);
               Rect.Left := Rect.Left + ImageList1.Width;
               If (JournalMode(Index) div 10) = (JournalMode(Index + 1) div 10) then
                  ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 1)
               else
                   ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 2);
               Rect.Left := Rect.Left + ImageList1.Width;
               Case JournalMode(Index) mod 10 of
               1 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 2);
               2 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 3);
               3 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 4);
               end;
               Rect.Left := Rect.Left + ImageList1.Width;
          end
          else
              If JournalMode(Index) <> 0 then
              begin
                   If (JournalMode(Index) div 10) <> 6 then
                      ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 1)
                   else
                       ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 2);
                   Rect.Left := Rect.Left + ImageList1.Width;
                   iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 1);
                   Rect.Left := Rect.Left + ImageList1.Width;
              end
              else
              begin
                   iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 0);
                   Rect.Left := Rect.Left + ImageList1.Width;
              end;
          DrawText (Canvas.Handle, PChar(Items[Index]), Length(Items[Index]),
                   Rect, DT_VCENTER);
     end;
end;

end.
--End Pasted Code--
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:millerw
ID: 1339444
object Form1: TForm1
  Left = 200
  Top = 112
  Width = 544
  Height = 375
  Caption = 'Form1'
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  PixelsPerInch = 96
  TextHeight = 13
  object ComboBox1: TComboBox
    Left = 40
    Top = 48
    Width = 441
    Height = 26
    Style = csOwnerDrawFixed
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -17
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ItemHeight = 20
    Items.Strings = (
      'All Journals'
      'General Journal'
      'Add'
      'Edit'
      'Undelete'
      'U.S. Cash Receipts'
      'Add'
      'Edit'
      'Undelete'
      'U.S. Cash Disbursements'
      'Add'
      'Edit'
      'Undelete'
      'Currency Conversion'
      'Add'
      'Edit'
      'Undelete'
      'Local Currency Cash Receipts'
      'Add'
      'Edit'
      'Undelete'
      'Local Currency Cash Disbursements'
      'Add'
      'Edit'
      'Undelete')
    ParentFont = False
    TabOrder = 0
    OnDrawItem = ComboBox1DrawItem
  end
  object iltJournal: TImageList
    Left = 8
    Bitmap = {
      3620000005000000424D36200000000000003600000028000000400000002000
      0000010020000000000000200000000000000000000000000000000000000000
      0000000000000021210000424200004242000042420000424200004242000042
      4200004242000042420000212100000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400002121000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000021210000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B00ADEFEF00ADEFEF00ADEFEF00ADEFEF00ADEFEF00ADEF
      EF00ADEFEF00ADEFEF0000848400008484000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000212121007BBDBD005A9C9C007BBDBD007BBDBD007BBDBD0000427B000042
      7B007BBDBD007BBDBD0000212100006363000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000DEDEDE00FFFFFF00DEDEDE00BDBDBD00BDBDBD00BDBDBD0021215A000000
      FF005A5A5A00BDBDBD0000424200006363000021210000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000039393900FFFFFF00DEDEDE0021212100DEDEDE00FFFFFF007B7B7B000000
      FF0000007B00FFFFFF00395A5A00008484000042420000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000003939390021212100000000007B7B7B00BDBDBD000000BD000000
      FF0000007B00FFFFFF00FFFFFF00395A5A00395A5A0021212100000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000BD00000000000000000000007B000000BD000000FF000000
      FF0000007B00BDBDBD00BDBDBD00BDBDBD00BDBDBD007B7B7B00000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000BD000000FF000000FF000000FF000000FF000000FF000000FF000000
      BD00BDBDBD00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      39000000FF000000FF000000FF000000FF000000FF000000FF0000007B007B7B
      7B00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000039000000FF0000007B0000007B0000007B0000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000390000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000021210000424200004242000042420000424200004242000042
      4200004242000042420000212100000000000000000000000000000000000000
      0000000000000021210000424200004242000042420000424200004242000042
      4200004242000042420000212100000000000000000000000000000000000000
      0000000000000021210000424200004242000042420000424200004242000042
      4200004242000042420000212100000000000000000000000000000000000000
      000000000000000000000000000000000000000000000000000000000000C6C6
      C600848484000000000000000000000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400002121000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400002121000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400002121002121210000000000000000000000
      00000000000000000000000000000000000000000000FF000000848484000000
      0000C6C6C600C6C6C60084848400000000000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000636300004242000021210000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000021210000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE00002121007B7B7B00EFEFEF0031313100000000000000
      000000000000000000000000000000000000FF00000084848400FF0000000000
      0000FF00000000000000C6C6C600C6C6C6008484840000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0052ADAD00DE390000FF7B00000000000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0031525200009C9C00395A5A009494940000000000000000000000
      0000000000000000000000000000FF00000084848400FF0000000000FF00C6C6
      C6008484840000000000FF00000000000000C6C6C60000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0052ADAD00DE390000FFBD0000BD0000000021210000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0031525200009C9C0000BDBD0000DEDE000000000000000000000000000000
      00000000000000000000FF00000084848400FF0000000000FF000000FF000000
      0000C6C6C600C6C6C6008484840000000000FF00000000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0052AD
      AD00DE390000FFBD0000BD000000006363000042420000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE0063DE
      DE0063DEDE0063DEDE0000848400008484000042420000000000000000000000
      0000000000007B7B7B0063DEDE0063DEDE0063DEDE0063DEDE0063DEDE003152
      5200009C9C0000BDBD0000DEDE00004242000042420000000000000000000000
      0000000000000000000084848400FF0000000000FF0000000000848484000000
      00000000FF0000000000C6C6C600C6C6C6008484840000000000000000000000
      0000000000007B7B7B00ADEFEF006BADAD00316B6B00316B6B00528C8C00CE6B
      6B00CECE5200BD00000000636300008484000042420000000000000000000000
      0000000000007B7B7B00ADEFEF00ADEFEF00ADEFEF00ADEFEF00ADEFEF00ADEF
      EF00ADEFEF00ADEFEF0000848400008484000042420000000000000000000000
      0000000000007B7B7B00ADEFEF00ADEFEF00ADEFEF00ADEFEF0031525200009C
      9C0000BDBD0000DEDE0000424200008484000042420000000000000000000000
      00000000000000000000000000000000FF00FF00FF0000000000C6C6C600C6C6
      C60084848400000000000000FF0000000000C6C6C60000000000000000000000
      0000212121007BBDBD00527373009C9C3900BDBD3900BDBD39007B7B00005252
      3100636363007B9C9C0000212100006363000042420000000000000000000000
      0000212121007BBDBD005A9C9C007BBDBD007BBDBD0000427B000042BD00397B
      7B007BBDBD007BBDBD0000212100006363000042420000000000000000000000
      0000212121007BBDBD005A9C9C007BBDBD007BBDBD0000424200009C9C0000BD
      BD0000DEDE00395A5A0000212100006363000042420000000000000000000000
      000000000000000000000000FF00FF00FF00FF00FF0000000000FF00FF000000
      0000C6C6C600C6C6C60084848400000000000000FF0000000000000000000000
      0000DEDEDE00BDBDBD00EFEF6B00FFFF7B00FFFF7B00FFFF7B00FFFF7B009C9C
      00005A5A5A00BDBDBD0000424200006363000021210000000000000000000000
      0000DEDEDE00FFFFFF00DEDEDE00BDBDBD0039397B000000FF000000FF000000
      BD009C9C9C00BDBDBD0000424200006363000021210000000000000000000000
      0000DEDEDE00FFFFFF00DEDEDE00BDBDBD00395A5A00009C9C0000BDBD0000DE
      DE0021424200BDBDBD0000424200006363000021210000000000000000000000
      00000000000000000000FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00
      FF00FF00FF0000000000C6C6C600C6C6C6000000FF0000000000000000000000
      000039393900BDBD7B00FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF
      7B0042420000FFFFFF00395A5A00008484000042420000000000000000000000
      000039393900FFFFFF00DEDEDE000000000000007B000000FF000000FF000000
      BD0000003900FFFFFF00395A5A00008484000042420000000000000000000000
      000039393900FFFFFF00DEDEDE0000212100009C9C0000BDBD0000DEDE00395A
      5A00FFFFFF00FFFFFF00395A5A00008484000042420000000000000000000000
      000000000000FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00
      FF00FF00FF00FF00FF00FF00FF00000000000000000000000000000000000000
      000000000000BDBD7B00FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF
      7B0042420000FFFFFF00FFFFFF00395A5A00395A5A0021212100000000000000
      000000000000393939002121210000000000212121000000FF000000FF000000
      7B00FFFFFF00FFFFFF00FFFFFF00395A5A00395A5A0021212100000000000000
      00000000000039393900424242000021210000BDBD0000DEDE00395A5A00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00395A5A00395A5A0021212100000000000000
      000000000000FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
      FF00FF00FF00FF00FF00FF00FF00FF00FF000000000000000000000000000000
      0000000000007B7B4200FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF7B00FFFF
      7B0042422100BDBDBD00BDBDBD00BDBDBD00BDBDBD007B7B7B00000000000000
      000000000000000000000000000000000000000000000000FF000000FF000000
      BD009C9C9C00BDBDBD00BDBDBD00BDBDBD00BDBDBD007B7B7B00000000000000
      00000000000021212100DEDEDE009C9C9C000039390021424200BDBDBD00BDBD
      BD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD007B7B7B00000000000000
      00000000000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
      FF00FF00FF00FF00FF00FF00FF00000000000000000000000000000000000000
      00000000000021212100DEDE9C00FFFF7B00FFFF7B00FFFF7B00FFFF7B007B7B
      3900BDBDBD00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000
      000000000000000000000000000000000000000000000000BD000000FF000000
      FF007B7B7B00FFFFFF00FFFFFF00FFFFFF00BDBDBD00FFFFFF00000000000000
      00002121420039393900CECECE009494940021212100BDBDBD00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000
      0000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
      FF00FF00FF00FF00FF0000000000000000000000000000000000000000000000
      00000000000000000000212121007B7B7B00BDBD7B00BDBD7B005A5A5A007B7B
      7B00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00000000000000
      00000000000000000000000000000000000000000000000039000000FF000000
      FF000000BD009C9C9C00BDBDBD007B7B7B000000BD005A5A5A00000000004242
      63000000BD00000063002121210021212100000000007B7B7B00BDBDBD00BDBD
      BD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00000000000000
      00000000000000000000000000000000000000000000FF00FF00FF00FF00FF00
      FF00FF00FF000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      00000000000000000000000000000000000000000000000000000000BD000000
      FF000000FF000000BD0000007B000000FF000000390000000000000000004242
      9C00000084000000630042424200000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      000000000000000000000000000000000000000000000000000000000000FF00
      FF00000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      BD000000FF000000FF000000BD00000039000000000000000000000000002121
      2100636363004242420000000000000000000000000000000000000000000000
      000000000000000000000000000000000000000000000000000000000000424D
      3E010000000000003E0000002800000040000000200000000100010000000000
      000100000000000000000000020000000200000000000000FFFFFF00C00F0000
      00000000C007000000000000C003000000000000C003000000000000C0030000
      00000000C003000000000000C003000000000000800300000000000000030000
      000000008001000000000000C801000000000000800000000000000000000000
      00000000000000000000000081FF000000000000CFFF000000000000FE7FC00F
      C00FC00CFC1FC007C007C000F807C003C003C001F001C003C003C001E003C003
      C003C003C001C003C003C003C001C003C003C003E001800380038003E0010003
      00030003E003800180018001C007C001C801C0018007C000F800C000800FC000
      F8008000E01FE000FC000400F83FFFFFFC030FFFFE7FFFFFFE071FFF}
  end

0
 
LVL 1

Author Comment

by:millerw
ID: 1339445
 object ImageList1: TImageList
    Height = 20
    Width = 20
    Left = 48
    Bitmap = {
      F612000003000000424DF61200000000000036000000280000003C0000001400
      00000100200000000000C0120000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000008080800000000000808080000000
      0000808080000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000808080000000000080808000000000008080800000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000080808000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000808080000000
      000000000000000000000000000000000000000000000000000000000000424D
      DE000000000000003E000000280000003C000000140000000100010000000000
      A00000000000000000000000020000000200000000000000FFFFFF00FFFFFFFF
      FFFFFFF0FFEFFFFEFFFFFFF0FFFFFFFFFFFFFFF0FFEFFFFEFFFFFFF0FFFFFFFF
      FFFFFFF0FFEFFFFEFFFFFFF0FFFFFFFFFFFFFFF0FFEFFFFEFFFFFFF0FFFFFFFF
      FFFFFFF0FFEFFFFEAAFFEAA0FFFFFFFFFFFFFFF0FFEFFFFEFFFFEFF0FFFFFFFF
      FFFFFFF0FFEFFFFEFFFFEFF0FFFFFFFFFFFFFFF0FFEFFFFEFFFFEFF0FFFFFFFF
      FFFFFFF0FFEFFFFEFFFFEFF0FFFFFFFFFFFFFFF0FFEFFFFEFFFFEFF0}
  end
end
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1339446
come on Matvey, you can do it! c.u. Zif.
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339447
Yeah man, it's time to cut off the crap and start earning money! How about $200? :-)

OK Scott, it's actually not as easy as I thought in the beginning - there is no other workaround but a component.
I made a small descendant of the combo so it doesn't automatically draw the marquee, and it distinqushes between items in the actual list and the item shown in the edit area. So basically it solvs both problems.

Just install the following component, and put it instead of your combo.
________________________________________________________________________________
unit ODComboBox;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type

  TOwnerDrawState = set of (odSelected, odGrayed, odDisabled, odChecked, odFocused, odCOMBOBOXEDIT);

  TDrawItemEvent = procedure(Control: TWinControl; Index: Integer; Rect: TRect;
    State: TOwnerDrawState) of object;


  TODComboBox = class(TComboBox)
  private
    FOnDrawItem: TDrawItemEvent;
    procedure CNDrawItem(var Message: TWMDrawItem); message CN_DRAWITEM;
  protected
    procedure DrawItem(Index: Integer; Rect: TRect;
      State: TOwnerDrawState);
  published
    property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
  end;                      //    replaced so it doesn't draw the marquee itself

procedure Register;

implementation

procedure TODComboBox.DrawItem(Index: Integer; Rect: TRect;
  State: TOwnerDrawState);
begin
  if Assigned(FOnDrawItem) then FOnDrawItem(Self, Index, Rect, State)
  else
  begin
    Canvas.FillRect(Rect);
    Canvas.TextOut(Rect.Left + 2, Rect.Top, Items[Index]);
  end;
end;

procedure TODComboBox.CNDrawItem(var Message: TWMDrawItem);
var
  State: TOwnerDrawState;
  S: LongInt;
begin
  with Message.DrawItemStruct^ do
  begin
    S := itemState;
    if S >= ODS_COMBOBOXEDIT then begin
      State := [odCOMBOBOXEDIT];
      Dec(S, ODS_COMBOBOXEDIT);
    end;
    if S >= ODS_FOCUS then begin
      State := state + [odFocused];
      Dec(S, ODS_FOCUS);
    end;
    if S >= ODS_SELECTED then
      State := state + [odSelected];

    Canvas.Handle := hDC;
    Canvas.Font := Font;
    Canvas.Brush := Brush;
    if (Integer(itemID) >= 0) and (odSelected in State) then
    begin
      Canvas.Brush.Color := clHighlight;
      Canvas.Font.Color := clHighlightText
    end;
    if Integer(itemID) >= 0 then
      DrawItem(itemID, rcItem, State) else
      Canvas.FillRect(rcItem);
    Canvas.Handle := 0;
  end;
end;

procedure Register;
begin
  RegisterComponents('Samples', [TODComboBox]);
end;

end.
________________________________________________________________________________

Next, to test the new capabilities, rewrite the ComboBox1DrawItem sub. Most of it is like it was before.

________________________________________________________________________________
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
   FRect: TRect;
   edittext: String;
begin
     With Control as TComboBox do
     begin
                                             //display the text in the edit area
       if odCOMBOBOXEDIT in State then begin
          edittext := '';
          case JournalMode(Index) mod 10 of
            1 : edittext := 'Add to ';
            2 : edittext := 'Edit ';
            3 : edittext := 'Undelete ';
          end;
          if not (JournalMode(Index) div 10 = 0) then
            edittext := edittext + Items[1+4*(JournalMode(Index) div 10-1)]
          else
            edittext := Items[0];
          DrawText (Canvas.Handle, PChar(edittext), length(edittext), Rect, DT_VCENTER);
          exit;
       end;
          If (JournalMode(Index) mod 10) <> 0 then
          begin
               If (JournalMode(Index) div 10) <> 6 then
                  ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 0);
               Rect.Left := Rect.Left + ImageList1.Width;
               If (JournalMode(Index) div 10) = (JournalMode(Index + 1) div 10) then
                  ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 1)
               else
                   ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 2);
               Rect.Left := Rect.Left + ImageList1.Width;
               Case JournalMode(Index) mod 10 of
               1 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 2);
               2 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 3);
               3 : iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 4);
               end;
               Rect.Left := Rect.Left + ImageList1.Width;
          end
          else
              If JournalMode(Index) <> 0 then
              begin
                   If (JournalMode(Index) div 10) <> 6 then
                      ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 1)
                   else
                       ImageList1.Draw(Canvas, Rect.Left, Rect.Top, 2);
                   Rect.Left := Rect.Left + ImageList1.Width;
                   iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 1);
                   Rect.Left := Rect.Left + ImageList1.Width;
              end
              else
              begin
                   iltJournal.Draw(Canvas, Rect.Left + 2, Rect.Top + 2, 0);
                   Rect.Left := Rect.Left + ImageList1.Width;
              end;

          DrawText (Canvas.Handle, PChar(Items[Index]), Length(Items[Index]),
                   Rect, DT_VCENTER);
                                                           //draw the focus rect
          If odFocused in State then begin
            FRect := Rect;
            Frect.Right := FRect.Left + Canvas.TextWidth(Items[index]);
            DrawFocusRect(Canvas.Handle, FRect)
          end;
     end;
end;
________________________________________________________________________________

That's it for today ;)
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339448
What?! You think it's long, unclear and uncommented?! You bet it is! :)
Actually it's not that bad. Anyway please ask whatever is unclear.
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339449
Oh, guys, I need a quick advice: anybody here has a scanner? Please advise me what should I buy...
-Thanks
0
 
LVL 1

Author Comment

by:millerw
ID: 1339450
Matvey,

Unfortunately, I'm not getting the same results.  I've cut and pasted the code above into the newly created combo box (actually I used GExperts to Component Replace) that you designed.  I'm getting incomplete draws and it is telling me that every selected item is in the ComboEditBox.  

Then I tried to modify my original code above to add the focus bar and drawing of the edit box.  Sure enough, every selected item comes out as being in the ComboEditBox.  EG As you move your cursor up and down the drop down, each selected item changes from the way it should be displayed to the "Add to General Journal" type of display.

Scott
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339451
Works fine for me. Know what, try doing this using the "hammer" techniq:

1) Install the component
2) don't use any component replace functions from GExperts, but just put a new TODComboBox on the form, and copy the old one items into it. Assign it's OnDrawItem to the old procedure, and try again.
0
 
LVL 1

Author Comment

by:millerw
ID: 1339452
Same thing.

This may have nothing to do with the code.  What version of Delphi are you using?  I'm still on 3 at the moment.  Thus, I need this to work for 3.

BTW, when I look at State I get "[odChecked, odComboBoxEdit..(out of bound) 6].  That looks like the problem.  You shouldn't be getting an out of bound exception occuring.

Scott
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339453
Scott, I'm sorry, I had to give my PC for a repair, and I see you haven't received what I sent you. I sent you the test project and the executable, because it's worthless to copy it to here and have misunderstandings, alright? If you have a different email let me know, and I'll sent it again.
Apologize again for the delays, and waiting for comments. Well, hope it works now at least (check the exe first...)

--Matvey
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1339454
nice your back Matvey... hey why didn't you repaired your PC yourself :-). Zif.
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339455
Hey Tom! I still remember you promised me some notes about your trip ;-)
Actually, just the thought of opening the machine and disconnecting something scares me to death! I remember I tried to install something myself sometime... PHEW! fuhgedubudit... I really screwen it all up! So now I don't even bother... just press the big green button, then press Start and then towards Delphi, that's all I can, if you know what I mean ;-)
0
 
LVL 1

Author Comment

by:millerw
ID: 1339456
I'm back from Germany today, so I'll look into your e-mail.  I got it, but it came while I was in Germany.  I'll see what I get with it and get back to you.

Thanks for your patience,
Scott
0
 
LVL 3

Accepted Solution

by:
Matvey earned 200 total points
ID: 1339457
Hey Scott, my income tax please ;-)

Just drop me an email anytime, and I'll give you a hand...
Bye!
0
 
LVL 1

Author Comment

by:millerw
ID: 1339458
It works.  What more could I ask for :-)

Remember to give the government its share :-)

Thanks (and remember your promise),
Scott
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now