Ray Konopka

Forum Replies Created

Viewing 15 posts - 181 through 195 (of 343 total)
  • Author
    Posts
  • in reply to: TrzSelectFolderDialog Sort Option? #2553
    Ray Konopka
    Keymaster

      You can affect the sorting of the ShellTree used by the RzSelectFolderDialog component by do a little bit of a hack. For example,

      uses
        RzShellFolderForm;
      
      procedure TForm13.RzButton1Click(Sender: TObject);
      begin
        RzSelectFolderDialog1.Execute;
      end;
      
      function CustomSortProc(Node1, Node2: TTreeNode; Data: Integer): Integer; stdcall;
      begin
        Result := -AnsiStrIComp(PChar(Node1.Text), PChar(Node2.Text));
      end;
      
      procedure TForm13.RzSelectFolderDialog1FormShow(Sender: TObject);
      begin
        TRzSelectFolderForm( RzSelectFolderDialog1.Form ).ShellTree.CustomSort(@CustomSortProc, 0);
      end;

      This example will reverse sort the nodes in the Shell Tree.

      The problem is that there is no simple way to get at the information you want to sort on. That is, the date modified. That information is not tracked with each node in the Shell Tree. You may be able to do some other lookup to get the information you need, then you could modify the CustomSortProc function to sort by modified date.

      Ray

      in reply to: TRZComboBox csSimple Style. #2552
      Ray Konopka
      Keymaster

        Hi Steve,

        The csSimple style is a very old style of Windows COMBOBOX. It is essentially a and edit box and a list (just like what we typically think of as a combo box), but the edit box and list box are always visible.

        If you drop a TComboBox or TRzComboBox onto a form and then change the Style to csSimple you will notice that the drop arrow goes away. What is not so obvious is that you can then use the drag handles to make the control taller. When you do this, you will see the list portion of the control become visible.

        BTW, the controls used in the standard Font dialog box (for font name, style, and size) are “simple” combo boxes.

        Hope this helps,
        Ray

        in reply to: tRzTreeView change node font #2538
        Ray Konopka
        Keymaster

          Hi Jay,

          The TRzTreeView is a descendant of the TTreeView and inherits the same properties and events. Specifically, you can do some customizations by handle the OnAdvancedCustomDrawItem event.

          For example, I created a test app where I dropped a TRzTreeView on the form. I then added a FormCreate event handler, and an event handler for the tree view’s OnAdvancedCustomDrawItem event.

          procedure TForm11.FormCreate(Sender: TObject);
          var
            Node: TTreeNode;
          begin
            Node := RzTreeView1.Items.Add( nil, 'One' );
            RzTreeView1.Items.AddChild( Node, 'AAAA' );
            RzTreeView1.Items.AddChild( Node, '1111' );
          
            Node := RzTreeView1.Items.Add( nil, 'Two' );
            RzTreeView1.Items.AddChild( Node, 'BBBB' );
            RzTreeView1.Items.AddChild( Node, '2222' );
          
            Node := RzTreeView1.Items.Add( nil, 'Three' );
            RzTreeView1.Items.AddChild( Node, 'CCCC' );
            RzTreeView1.Items.AddChild( Node, '3333' );
          
            RzTreeView1.FullExpand;
          end;
          
          procedure TForm11.RzTreeView1AdvancedCustomDrawItem( Sender: TCustomTreeView; Node: TTreeNode;
                                                               State: TCustomDrawState;
                                                               Stage: TCustomDrawStage;
                                                               var PaintImages, DefaultDraw: Boolean);
          begin
            if Node.Text = 'AAAA' then
              RzTreeView1.Canvas.Font.Color := clRed
            else if Node.Text = 'BBBB' then
              RzTreeView1.Canvas.Font.Color := clBlue
            else
              RzTreeView1.Canvas.Font.Color := clBlack;
          end;

          When you run the app, you will see the AAAA and BBBB in their respective colors.
          Hope this helps.

          Ray

          in reply to: KSVC 6.5.0 and now 7.0 #2514
          Ray Konopka
          Keymaster

            Hi Goran,
            Embarcadero added better support for HighDPI in the controls in version 7. Yes, you will need to uninstalled 6.5.0 from RAD Studio 10.4 before installing version 7. Unfortunately, Embarcadero does not state this anywhere in GetIt and they did not create the installer to check if version 6.5 is already installed. So, if you have 6.5 installed and try to install version 7, you’ll get some odd errors about packages already being loaded. The solution is to use the GetIt Package Manager to uninstall version 6.5 first, then install 7.0.

            Hope this helps.
            Ray

            in reply to: Compiling RCDemo – does not compile #2513
            Ray Konopka
            Keymaster

              Thanks!

              in reply to: Compiling RCDemo – does not compile #2510
              Ray Konopka
              Keymaster

                Hi Mark,

                You did not do anything wrong. The demo was simply not updated for the 6.5.0 and 7.0.0 releases. Fortunately, it is easy to fix. For the UsingSystemStyle error add Self as a parameter:

                if UsingSystemStyle( Self ) then …

                After fixing the first one, you will get a couple more. Then you will get an error with the call to GetGradientPanelFrameColor. Again, you can simply add Self as the first parameter:

                C := GetGradientPanelFrameColor( Self, FCurrentGCS )

                Ray

                in reply to: Version 6 wishlist ? #2509
                Ray Konopka
                Keymaster

                  Niels,

                  CodeSite 4 did provide a way to block individual message types in the Dispatcher. There was a Blocked Messages tab (along with a Blocked Categories) in the Settings. However, we removed it from CodeSite 5 because it was hardly ever used and added more complexity to the Dispatcher.

                  Your request is interesting in that you are blocking the message types from the logging side. However, your example use case is a bit confusing to me. In the RELEASE case, the logger itself is disabled so blocking message types would make no difference.

                  Could you elaborate more on how you would like to use this functionality?

                  Ray

                  in reply to: Version 6 wishlist ? #2508
                  Ray Konopka
                  Keymaster

                    David,

                    Interesting idea. No promises, but I’ll add it to the enhancement request list.

                    Ray

                    in reply to: Does the Dispatcher SEND or POST TCP messages ? #2481
                    Ray Konopka
                    Keymaster

                      Hi David,
                      I sincerely apologize for the delay in responding to your message. In regards to the dispatching of messages, there are multiple connections that are involved and that may be impacting your observations.

                      The connection is between your application code and the CodeSite Dispatcher. Communication on this connection defaults to WM_COPYDATA, but may also be TCP.

                      The next connection is between the CodeSite Dispatcher and the ultimate Destination (e.g. Live Viewer, Log File, Remote CodeSite Dispatcher).

                      For the Live Viewer, in CodeSite 5, the Dispatcher always uses WM_COPYDATA to send messages to the Live Viewer.

                      To send messages to a Remote Dispatcher, the local Dispatcher will of course use TCP to send those messages.

                      Where it can get a little confusing is that it is possible to have your logging class send its messages directly to a remote CodeSite Dispatcher using the ConnectUsingTcp(host,port) method.

                      So with all of that said, when it comes to measuring performance, it is important to define what is being measured. For example, in your test above with sending 10,000 messages, are you recording the time it takes to send those messages from your application code? Or, are you measuring the time it takes for all the messages to appear in the Live Viewer.

                      One of the primary benefits of the Dispatcher is that the work of “dispatching” the messages is offloaded onto the Dispatcher and not your application.

                      Ray

                      in reply to: TRzCalendar Cell Colours. #2480
                      Ray Konopka
                      Keymaster

                        Hi Steve,

                        So sorry for the long delay. I hope you were able to locate the OnGetDayFormat event, which allows you to do what you wish. For example, the following event handler colors May 4 green in honor of Grogu (Baby Yoda).

                        procedure TForm7.RzCalendar1GetDayFormat(Sender: TObject; DayDate: TDateTime; Year, Month, Day: Word; var DayColor,
                          DayFontColor: TColor; var DayFontStyle: TFontStyles);
                        begin
                          if ( Month = 5 ) and ( Day = 4 ) then
                          begin
                            DayColor := clGreen;
                            DayFontColor := clWhite;
                          end;
                        end;
                        

                        Ray

                        in reply to: Codesite Viewer bug #2456
                        Ray Konopka
                        Keymaster

                          Thanks for the report. It will get fixed in CS6. I actually thought that was related to z-order problems that Delphi addressed a few versions back. Clearly something else is going on.

                          Ray

                          in reply to: Missing Variants #2455
                          Ray Konopka
                          Keymaster

                            There will probably not be another release of CS5 before CS6 is released. Well, at least I hope that is the case.

                            Ray

                            Ray Konopka
                            Keymaster

                              Hi,
                              Instead of trying to adorn the display of the tab with a separate image, what about changing the image that is referenced by the image list. For example, I created a new test project by dropping a TRzPageControl onto the main form. I then added 3 tab sheets. I then dropped a TImageList component onto the form. I then set the RzPageControl1.Images property to ImageList1. I then added an image to the image list. And next, I set the ImageIndex for the first tab so that the image in the image list was visible on the tab.
                              Next, I dropped a TRzButton on the form and created an OnClick event handler:

                              procedure TForm2.RzButton1Click(Sender: TObject);
                              var
                                B: TBitmap;
                                R: TRect;
                              begin
                                R := Rect( 0, 0, 16, 16 );
                                B := TBitmap.Create;
                                B.Width := 16;
                                B.Height := 16;
                                B.Canvas.Brush.Color := clRed;
                                B.Canvas.Pen.Color := clWhite;
                                B.Canvas.Pen.Width := 1;
                                B.Canvas.Rectangle( R );
                                B.Canvas.Font.Color := clWhite;
                                B.Canvas.Brush.Style := bsClear;
                                B.Canvas.TextRect( R, 2, 2, '23' );
                                ImageList1.Replace( 0, B, nil );
                              end;

                              The event handler creates a new image dynamically and then replaces the image in the image list. So, when you click on the button, the image for the first tab shows 23 in an image.
                              Ray

                              in reply to: Missing Variants #2448
                              Ray Konopka
                              Keymaster

                                Hi David,
                                I’ll add both of your requests to the list for CodeSite 6.
                                Ray

                                Ray Konopka
                                Keymaster

                                  Hi Patrick,
                                  I’m not entirely sure what you are trying to accomplish. The first thing that comes to mind is why not just use the built in support for displaying images on each tab? That is, drop a TImageList onto the form and then populate the image list with the images you want to display. You can dynamically add images to an image list at runtime if necessary. Then assign the image list instance to the TRzPageControl.Images property. Then for each TRzTabSheet, you can set the ImageIndex property to display the image. There are other Image**** properties that can be used to control the position of the image as well.

                                  Ray

                                Viewing 15 posts - 181 through 195 (of 343 total)