Jump to content

aehimself

Members
  • Content Count

    1090
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by aehimself

  1. aehimself

    looking for a "special" checkbox component

    A ComboBox suffers from the same 2-click issue and while it does save space, still not the usual way to handle these inputs. If UI space is an issue you should be looking at how to increase the space, not on workarounds. Unfortunately at work people were doing something similar and just pulled things closer together when they ran out of UI space (or the infamous pagecontrols on tabsheets). The end result physically hurts to look at.
  2. aehimself

    looking for a "special" checkbox component

    I advise against the use of TCheckBox or similar for such an input. There are multiple reasons: "greyed" state doesn't clearly mean "not sure" AND you might have to click twice to change your answer from one answer to the other. I'd suggest to have three radio buttons, right next to each other, with each column having a title; like an online questionare. Somthing like this:
  3. If you are sure you can not put the component in sync mode somehow, what you can do is: - Create a thread, have a private boolean called "_requestcompleted" - Create the component in the thread's context - Set the event handlers, flip _requestcompleted to True in the handler when... well, the request is completed - in the thread's context, send the request and then have a loop like... Repeat // Message pump, if needed for the component Sleep(100); Until _requestcompleted Or Self.Terminated; This method is inefficient as the CPU is spinning in a loop but at least easy to understand. If your component needs no message pump, you can switch to events and use WaitForMultipleObjects for a more resource-friendly approach.
  4. You are talking about two completely different areas with completely different functionality. A component is displaying / allowing to change a value, The source of said value is the dataset, which can behave in multiple different ways... either send the data to it's connection, use CachedUpdates or simply Cancel and revert to the unchanged state. The connection will be the one deciding when the data will be written to the database by further caching and transactions. You don't want to mix the functionality, especially if that functionality already exists. Spend that free time further improving your component, to display and change a value only 🙂
  5. aehimself

    TButtonEdit and left button dropdown menu

    I see. Thank you for confirming.
  6. aehimself

    TButtonEdit and left button dropdown menu

    Isn’t the dropdown menu a TPopupMenu? Or you mean in this scenario the property is not populated?
  7. aehimself

    TButtonEdit and left button dropdown menu

    Not sure if it will work here but you can try to check the TPopupMenu.PopupComponent property.
  8. aehimself

    Direct vs. Indirect access of service by a Client?

    Zeos recently implemented a Proxy driver which does exactly what you describe - it only exposes the proxy and client apps “connect” to this proxy. It supports all protocols which Zeos itself supports. I personally never tried it so I cannot say anything about security and such, but you can give it a try.
  9. aehimself

    Google Play requires Android 13 after 31. august !!!

    This is a clustermess. If you are publishing to Android you must have an update subscription so you can continue to be present; but even if you do you’ll do it on a beta platform which might not produce fully functioning code…? Am I getting it right…? Fortunately I’m not affected it; it just sounds extremely strange. I did not check the article but I’m sure the steps needed could be automatized and depleted via a patch.
  10. aehimself

    Application shortcut problem

    Is this shortcut to the exe what Delphi compiles? Windows Explorer caches the icon of executables and shortcuts so you might need to clear that cache for you to see the icon you just set.
  11. According to the stack trace it is indeed GDI object exhaustion. Check where and how you are manipulating images and make sure you are disposing of them properly. We had this when there was an image list on a frame which was created thousands of times. Moving the imagelist to a common place solved our issue immediately. @Dalija Prasnikar we also received EOutOfResources when our application used up all available user handles so it’s not strictly GDI-related. But yes, leaking handles often pop up as Delphi classes in the memory leak report.
  12. aehimself

    Using bold text in Listview

    Yes, it should be ListView1.Items.Add. If you declared your class like I posted (descending from “nothing” = TObject) it does not require an owner (not a parent). If the definition is correct, it’s still possible that the RTL has a component named TListItemData, so you can try to name yours “TMyListItemData” or something else - that will help the compiler to recognize which one you want to create and what parameters it requires.
  13. What OS the application is running on? Also, are you reusing your threads or creating and freeing them up as needed? On Windows 2000 creating and freeing up threads lead to the same error for me (probably due to memory fragmentation, idk) and the solution was to simply reuse threads.
  14. aehimself

    Using bold text in Listview

    It's not working with a global variable because you cannot make sure that it has the right value the moment the ListItem (re)draws an item (e.g. during scrolling). Instead, you have to tie this data to each independent node. Declare a type, e.g.: TListItemData = Class public BoldText: Boolean; End; Then, when adding a list item: var li := ListItem1.Items.Add; li.Data := TListItemData.Create; (li.Data As TListItemData).BoldText := True; To make sure you are not leaking memory, add an OnDeletion handler to your ListView: If Assigned(Item) Then Begin TListItemData(Item.Data).Free; Item.Data := nil; End; After all this, in your custom draw methods you can check the object's property: If Assigned(Item.Data) And (Item.Data As TListItemData).BoldText Then Sender.Canvas.Font.Style := [fsBold] Else Sender.Canvas.Font.Style := []; I did not run this code so some minor adjustments might be needed but the basics are this. Also, instead of a custom class you simply can create and assign a PBoolean to Node.Data, but a class is more versatile if you want to add more properties later on.
  15. aehimself

    Querying mvnrepository

    When you open the site in your browser you can check all the network calls made for the site to actually load. If you are lucky there will be an API call which returns the file list in a well-known format. Even if there is one, I don’t know however if you are allowed to query that API… the site owner will be able to tell you the legal parts.
  16. aehimself

    Querying mvnrepository

    In your browser it works because there are some JavaScript generating / fetching the data from somewhere else with your browser happily renders. You’ll need TEdgeBrowser or something similar to actually render it for you and then process the visible document.
  17. I wonder where @RRUZ got this unit. IF we are talking about the same component, according to it, TEditControl has two published properties: property CaretX: SmallInt; property CaretY: Integer; If we can find out how to access this type from a Delphi application (even without source) I'm sure TEditControl could be accessed via it's handle and some pointer magic...
  18. That's a pity. Unfortunately the source of TEditControl and TCustomEditControl is buried somewhere so we can not be sure what it can do, what it will reply to. Worths a try though, maybe...
  19. And here I thought the chatgpt hype died down already. Got proven wrong yet again 🙂
  20. Stupid question… can we integrate SpamAssassin or a similar (automatic) content checking to trigger flagging posts (posters) as spam?
  21. To open a file you can use DDE, which @Attila Kovacs got working some time ago: As for repositioning, you can try to get the handle of the editor control and send a EM_SETSEL message. That would be my approach, that is.
  22. aehimself

    Better Translator Manager - Custom component

    Resource strings are prefixed with the unit name they are in; so it should be named LocNavigator_pumAutoIns It must be there. Never met any resource string left out by BTM.
  23. aehimself

    Parsing Json to retrieve nested record

    Including the checks if a specific branch exists or not, you also can use the built-in System.Json unit: Var jo, coinmech: TJSONObject; recenum, tubeenum: TJSONValue; records, tubes: TJSONArray; begin jo := TJSONObject(TJSONObject.ParseJSONValue(Memo1.Text)); If Not Assigned(jo) Then Exit; Try records := jo.GetValue<TJSONArray>('records'); If Not Assigned(records) Then Exit; For recenum In records Do Begin coinmech := recenum.GetValue<TJSONObject>('coin_mech'); If Not Assigned(coinmech) Then Continue; tubes := coinmech.GetValue<TJSONArray>('tubes'); If Not Assigned(tubes) Then Continue; For tubeenum In tubes Do Begin WriteLn('Tube found, ID:' + tubeenum.GetValue<String>('tube_id')); // ... // Add a new record in a MemTable...? End; End; Finally FreeAndNil(jo); End; The code can be siplified significantly but this way you can see what is happening, how TJSONObject handling works. The code above produced the following output:
  24. Might still be disabled…? @Daniel can confirm this.
  25. While it works, storing and using data in the UI is never a good idea. If one day you want to change the ListBox to something else you’ll have to rewrite the whole logic. I’d suggest parsing (deserializing) the JSON into your custom class, filling the ListBox and extracting the ID from there when needed.
Ă—