Ray Konopka

Forum Replies Created

Viewing 15 posts - 301 through 315 (of 317 total)
  • Author
    Posts
  • in reply to: CodeSite 5 and RAD Studio 10.3 Rio #558
    Ray Konopka
    Keymaster

      You’re welcome. I’m glad you saw the notice on the website.

      Ray

      in reply to: TRzToolButton #497
      Ray Konopka
      Keymaster

        Hi,

        There is no built-in properties to allow this, but you could write event handlers for the OnMouseEnter and OnMouseLeave events and do something like this:

        procedure TForm4.RzToolButton1MouseEnter(Sender: TObject);
        begin
          RzToolButton1.Font.Color := clRed;
        end;
        
        procedure TForm4.RzToolButton1MouseLeave(Sender: TObject);
        begin
          RzToolButton1.Font.Color := clGreen;
        end;

        Ray

        in reply to: Delphi and c++ package #447
        Ray Konopka
        Keymaster

          Does the C++ Package include the CodeSiteExpressPkg package in the requires clause?

          Ray

          in reply to: Logging Json #446
          Ray Konopka
          Keymaster

            Thanks. I’ll fix it. Copy and paste error 🙂

            in reply to: Not Sure How to Do This. #445
            Ray Konopka
            Keymaster

              Hi Steve,
              I’ll have Jim, who is the architect of DropMaster, respond to your questions.

              Ray

              in reply to: CodeSite initialisation #424
              Ray Konopka
              Keymaster

                If the Dispatcher is getting started, then I suspect that you have another CodeSite.Send method being called before you are disabling the logging. To disable logging, be sure to call CodeSiteManager.Enabled := False before sending any CodeSite messages.

                Ray

                in reply to: Activation e-mail #423
                Ray Konopka
                Keymaster

                  Thanks for the message. The activation is handled by the forum plug-in that we are using for the site. I’ll look into it.

                  in reply to: TRzDBDateTimePicker show blank when value is Null? #420
                  Ray Konopka
                  Keymaster

                    Hi Chris,

                    You may have noticed that the TRzDBDateTimePicker has a grayed icon in the component palette. That is because it is deprecated. And the reason it is deprecated is precisely for the reason that you are running into. Because the TRzDBDateTimePicker (and TRzDateTimePicker) are descendants of the DateTime Picker Windows control, we are limited in what can be done with the content. The handling of null values is just one instance.

                    Instead, we recommend using the TRzDBDateTimeEdit component. The component does a much better job of handling null fields and allows for freeform input, making it more flexible. Plus, if you are editing field that contains both Date and Time values, you can drop two TRzDBDateTimeEdit controls onto your form and point them both to the same DB Field–one control edits the Date portion and the other edits the Time.

                    Ray

                    in reply to: Logging Json #419
                    Ray Konopka
                    Keymaster

                      Hi Harald,

                      You can download the CodeSiteJsonLogging unit from the Downloads section of my Delphi By Design blog (https://delphibydesign.com/downloads/). At the bottom of the page, in the CodeSite section, you will find the entry for the CodeSite JSON Logging download.

                      By the way, the next major release of CodeSite will have integrated support for JSON.

                      Ray

                      in reply to: TrzDbGrid #407
                      Ray Konopka
                      Keymaster

                        Hi,

                        In order for the OnDrawColumnCell event to fire, you need to set the DefaultDrawing property to False. Then you need to handle drawing the content of all the cells. Here is a simple example:

                        procedure TForm29.RzDBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn;
                          State: TGridDrawState);
                        begin
                          if Column.FieldName = 'AB' then
                            RzDBGrid1.Canvas.Brush.Color := clRed
                          else
                            RzDBGrid1.Canvas.Brush.Color := clYellow;
                          RzDBGrid1.DefaultDrawColumnCell( Rect, DataCol, Column, State );
                        end;

                        The code above results in every cell of the grid having a background of Yellow, except for the ‘AB’ column which has a background color of Red. The DefaultDrawColumnCell method is used to actually to the drawing.

                        Ray

                        in reply to: TRzComboBox #406
                        Ray Konopka
                        Keymaster

                          I apologize for the delay in responding. I did not realize you asked a follow-up question. Consider the following code. I have dropped a TRzComboBox, a TRzButton, and a TRzLabel onto a form.

                          procedure TForm29.FormCreate(Sender: TObject);
                          begin
                            RzComboBox1.AddItemValue( 'Item One', '1' );
                            RzComboBox1.AddItemValue( 'Item Two', '2' );
                            RzComboBox1.AddItemValue( 'Item Three', '3' );
                            RzComboBox1.AddItemValue( 'Item Four', '4' );
                            RzComboBox1.AddItemValue( 'Item Five', '5' );
                          end;

                          The above code adds several items and values to the list. You can get the Values by using the Values list property. For example:

                          procedure TForm29.RzButton1Click(Sender: TObject);
                          begin
                            RzLabel1.Caption := RzComboBox1.Values[ RzComboBox1.ItemIndex ];
                          end;

                          But the problem with this approach is that you need to protect against ItemIndex being -1, which will lead to an Index Out Of Bounds exception. A better approach is to simply use the Value property as shown below:

                          procedure TForm29.RzButton1Click(Sender: TObject);
                          begin
                            RzLabel1.Caption := RzComboBox1.Value;
                          end;

                          Ray

                          in reply to: TRzComboBox #398
                          Ray Konopka
                          Keymaster

                            Hi,
                            You can simply use the Value property of the combo box. If an item in the combo box is selected then the Value property returns the corresponding value for that item. If no item is selected, then Value returns an empty string.

                            Ray

                            in reply to: Best way to filter messages #396
                            Ray Konopka
                            Keymaster

                              Hi Marcos,

                              I apologize for the delay in responding. The short answer to your question is that you cannot filter CodeSite messages at the Dispatcher based on message type. You can filter messages based on Category at the Dispatcher level, but that is typically used once in a while in situations where filtering is needed but it is not possible to filter the messages at the program level.

                              Instead, most developers will filter the messages that get “sent” by CodeSite by creating multiple CodeSite loggers for use their applications. For example, one might create a csCritical logger (with its Category property set to Critical) that is always Enabled. That way, any CodeSite message sent by csCrtical will get dispatched to the destination. Other loggers might be named csDebug, csDevelop, csExternal, csCommunication, etc.

                              With the various loggers in place, developers simply use the appropriate logger to capture information. Moreover, many CodeSite users will provide a mechanism to enable/disable the various loggers used in their apps. This could be done through INI file settings, Registry entries, XML config files, etc.

                              Therefore, to control the amount of information generated by an app is handled by configuring the app and not by restricting the messages that are dispatched by the Dispatcher. Also, by using Categories, you can focus on the content of your CodeSite messages and not an arbitrary logging level for the message.

                              And finally, in order to update the Dispatcher settings, you need to have Admin rights. You can either start the Dispatcher as an Admin, or you can run the CodeSite Controller as an Admin at you will then be able to change the Dispatcher settings.

                              Ray

                              in reply to: iOS/Android/Linux/FreePascal support #345
                              Ray Konopka
                              Keymaster

                                Hi Marc,
                                CodeSite does not currently support iOS, Android, Mac, or Linux targets, but supporting these platforms is definitely on the roadmap. As for FreePascal support, we’ll add it to our list of things to investigate.

                                Ray

                                in reply to: TRzSendMessage #343
                                Ray Konopka
                                Keymaster

                                  Hi Randall,

                                  The TRzSendMessage component uses the Simple Messaging API (MAPI). As a result, Microsoft does have some information on MAPI. One interesting issue that was recently reported regarding TRzSendMessage was an application built with Delphi 2007 but was running on a 64-bit OS with a 32-bit version of Outlook. There is an interesting page from Microsoft that talks about the bitness of MAPI applications and the operating systems they are running on. The link is:

                                  https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/building-mapi-applications-on-32-bit-and-64-bit-platforms

                                  Perhaps this is what you are running into.

                                  Back to Simple MAPI. It really is a pretty simple interface and does rely on having an email client installed on the system. The component was originally created to facilitate applying for the Windows 95 Logo for an app. There are two big issues with Simple MAPI: 1) not all email clients support it the same way, and 2) when things go wrong, the errors returned from MAPI are notoriously vague–the most infamous being ErrorCode 2 – General Error.

                                  As an alternative, you may wish to consider sending emails from you app using the TIdSMTP component. An email client is not necessary for this component to send emails. However, you do need to specify an SMTP server to actually send the email messages.

                                  Ray

                                Viewing 15 posts - 301 through 315 (of 317 total)