Jump to content

emileverh

Members
  • Content Count

    66
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by emileverh


  1. 15 hours ago, Lainkes said:

    I managed to loop with ControlCount.

     

    First I disable all controls on my panel.

    Then I enable my PageControl.

    And as last I loop all mu controls on my PageControl and set them disabled.

    
                // SET ALL COMPONENTS TO READONLY
                  // Disable first all components
                  for I := 0 to RzPanel1.ControlCount - 1 do
                    RzPanel1.Controls[I].Enabled := False;
                  // Enable TabSheets
                  PageControl1.Enabled := True;
                  // Disable components in PageControl
                  for I := 0 to PageControl1.ControlCount - 1 do
                    PageControl1.Controls[I].Enabled := False;

    Thanks for the help and hints.

     

    Alain

    Use GetControls() new since Delphi 11 I believe. Just as an example for me to disable TcxEdit's only. But you can do your own stuff:

    for var ctrl in frmMain.GetControls([ceftAll]) do
        begin
          if (ctrl is TcxEdit) then
          begin
            TcxEdit( ctrl).Enabled := false;
          end;
        end;

     

    • Thanks 1

  2. Hi guys!

    I am using D12. I have lots of code for ID’s like this:

     

    type TProductID = record

      ID : nativeint;

    end;

     

    What I want is this:

    type TProductID = nativeint;

     

    And yes I know the last declaration works! But when you make a call to a procedure and you mixed the params by mistake you got no error. Is there any helper, record attribute, compiler directive or so where I did not think of?!?!

     

    procedure TForm6.FormCreate(Sender: TObject);
    begin
      var tmpid: TProductID := 6;
      AddToStock(tmpid, 100);
      AddToStock(100, tmpid);  // I want a compiler warning or error here!!!!!!!
    end;

    procedure TForm6.AddToStock(pid: TProductID; cnt: nativeint);  // Both uses internally nativeint
    begin
      ShowMessage(pid.ToString);
    end;

     

    Now I have lot's(!) of database code like this in my program....

     

    var cid : TCustomerID;

    var pid: TProductID;

    pid.ID := qryGetStockProductID.AsInteger;

    cid.ID := qryGetStocCustID.AsInteger;

     

    What I want is:

    pid:= qryGetStockProductID.AsInteger;

    cid := qryGetStocCustID.AsInteger;

     


  3. Hi!

     

    I installed ICS 9.1 today, wowww I am impressed. The demos are very impressive, compliments to the author(s) 😉 But also overwhelming with so much functionality. 

     

    Can you give me a direction where to look for with what is the easiest way to find a MySQL server ( with port 3306 open) on my LAN (192.168.x.x)? 

     

    Thanks in advance, Emile


  4. 53 minutes ago, Vandrovnik said:

    In forward declaration of a class, compiler immediatelly knows the size of that type. For records, their size would be unknown in forward declaration.

    That can be true, but that is 'not my problem' how to solve it. I use records a lot for several reasons (speed, memory management,....). And it would be VERY nice to have that.  


  5. Just now, PeterBelow said:

    All components that have the form as Owner (which includes all components dropped on the form in the IDE designer) are automatically destroyed when the form is destroyed. So your query components are destroyed but whether that automatically releases serverside resources depends on how the component, especially its destructor, is implemented. But a TFDQuery will close the query when it is destroyed, so your scenario is OK.

    Thanks for the quick reply!!  😉


  6. 11 hours ago, Fred Ahrens said:

    I don't need any new features.

    I just need that the existing features work as intended. And there are many areas where existing features need to be made usable again (e.g. refactoring, code formatting, HighDPI).

     

    OK, one new feature would be nice: compiling for Raspberry Pi. But fixing the existing features needs to be done first.

    Totally agree. Fix the existing things first....

    • Like 1

  7. 15 minutes ago, Pat Foley said:

    Outlook's contact info is a vcard file and calendar event is vcalendar *.vcs or *.ics file. The employee calendar shows the events provided by the calendars the employee has access to. 


    Example of email attachment
    https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-insert-attachment-to-recurring-meeting 

    You would simply add an event attachment to the email of employee.

     

    But better to educate the office staff how to use Outlook calendar by having the secretary set the events on the employee calendars as needed. 

    Employee leave requests are sent to office manager. If approved the secretary amends the department's calendar which updates the employee calendar.

    The employee looks at the calendar events provided by the secretary. The secretary knows when the employee knows of a calendar event by the employee opening an email with a calendar event attachment and confirming the event.

      
     

    Thanks for your answer. First the link does not work. And second my application is a planning tool where lots of mutations are done during the day. And adding email with attachments is not a good option ( we tought of that), because there will be a lots of mouse click work than and I don't want to run VBA scripts. Therefore I want full access to the local application, where the secretary has access to xxx employees. And I want to add/remove directly into Outlook. It already works for 1 calendar. But now I want to address one specific calendar.....that is my question

    • Like 1

  8. Hi team!

    I have a question; I have a situation where a secretary manages multiple calendars in Outlook. So from her manager, employee 1, employee 2, etc. Is it possible to get access to all calendars of all people? For example I want to put an appointment in the calendar of 'Employee 2' via Delphi 12.

     

    I now use the 'basic' access like:

    try
    
      myOutlook := GetActiveOleObject('Outlook.Application');
    except
    
      myOutlook := CreateOleObject('Outlook.Application');
    
    end;
    
    etc. etc.

    And that works. ( I use it for sending emails ). But I don't know you to use multiple calendars....

     

    Your help would be much appreciated!

    Thanks in advance,
    Emile


  9. 5 minutes ago, weabow said:

    I think it depends on the OS target.

    On Windows, I do not add any file

    On Android, I add lib-native-activity.so

    On MacOs I add libcdsqlite.dylib and libcrypto.dylib

    On IOS I add ... nothing

    On Linux I add ... nothing

     

    But I'm not sure all these libraries concern SQLite

     

    Great! I work only on the Windows platform. One DLL less 😉  So the Embarcadero guys did a translation found on the SQLITE.ORG source code to Delphi-Pascal? 


  10. 3 minutes ago, Uwe Raabe said:

    I for myself have never spent any time on this limitation, because I never had to (and probably never will) write that long string literals. Not only that the style guide is much stricter, it is just way less readable and thus I would never even think of doing that. In addition I would literally slap such code in the face of the developer presenting it to me. So better don't count me in here.

    One last remark, as said, it's this issue not shocking....

    I use DevExpress 'dxFormattedLabels' a lot. So in the string there will be extra markup code for setting text to bold and/or italic or change color. So the string can quickly become quite large. If you use a multi language app ( as I have Dutch and English for now), the string can grow beyond it's limitation.

     

    Break; never filed a request to EMB before, but I see they changed the status to OPEN and INTERNAL ASSIGNED. So there is a little hope 😉

     

    Have a nice day, to you all. And enjoy D11.3 as much as I do. There are lot's of improvements!!!

    • Thanks 1

  11. Nice your code... I can not use it! Because of a third party tool.

     

    I don't know how many Delphi programmers are here in this world. A few thousand sure, but if we sum all the time spend on this ( for me stupid) limitation lot's of money is thrown away. Is it a show stopper? No. Is it critical? No. Are there workarounds? Yes. The only thing I hope is that EMB changes this old fashion limitation. 

    • Like 1

  12. 8 minutes ago, PeterBelow said:

    The compiler accepts this without problems:

    
    const
      CTest =
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'+
        '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
        ;

     

    Yes I know you can use the '+' sign. But we have all seen this issue sooner or later. 255 chars is something for Delphi 1 or Delphi 2, not for Delphi 11 in 2023!

     

    I have third party tools for my mutli-language app. And if the string is too long everything stucks.  The only thing I ask for EMB, why can't they change 'const' or 'resourcestring' from 'shortstring' to string?

    • Like 1
×