Jump to content

Mark-

Members
  • Content Count

    314
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mark-

  1. Mark-

    TStyleManager.ActiveStyle...

    Hello, I provide the user a menu to select a desired style for the application. I have tested most styles and have trouble with only one, named “Windows”. As an example: Ruby Graphite Windows The window color for the text is wrong. Here is the code to fetch the background color and font color: procedure TDrawingSurface2.GetStyleColors(out bgColor, fColor: TColor); var actStyle:TCustomStyleServices; begin actStyle:=TStyleManager.ActiveStyle; if Assigned(actStyle) and actStyle.Enabled then begin bgColor:=actStyle.GetStyleColor(scWindow); fColor:=actStyle.GetStyleFontColor(sfWindowTextNormal); end else begin bgColor:=clWindow; fColor:=clWindowText; end; end; The else is never triggered. I can check for the style name “Windows” and return: bgColor:=clWindow; fColor:=clWindowText; and the dialog is correct. Any ideas? Thanks, Mark
  2. Mark-

    TStyleManager.ActiveStyle...

    Thanks for your help.
  3. Mark-

    TStyleManager.ActiveStyle...

    Like MessageDlg the dialog (MessageDlg2) resizes based buttons, button captions, based on OS language, font size, etc., and it was cleaner to use a panel. TLabel, at least, had other issues to overcome. Drawing on the form, I had not thought of that solution. Good idea. I had the framework for a custom panel, from another form, so I grabbed it. For now, because the only issue is the "Windows" style, window color, I check for it when fetching the window and font color, Down the road I might look at drawing on the form. It is an interesting, and perhaps a cleaner, solution. Thanks for your help Remy.
  4. Mark-

    TStyleManager.ActiveStyle...

    I "FillRect" the canvas of the panel, with the color returned by the style manager. There is not a label. I DrawText the text on the canvas. Amakrits style works.
  5. Mark-

    TStyleManager.ActiveStyle...

    Yes. ParentBackground state made no difference. The form color is set to clWindow.
  6. Mark-

    TStyleManager.ActiveStyle...

    The text is drawn on a TCustomPanel. The custom panel is on the form (TForm).
  7. Mark-

    TStyleManager.ActiveStyle...

    Sure.
  8. Mark-

    TStyleManager.ActiveStyle...

    You mean what all the other styles return, I guess I am confused. Perhaps I am all wet, 10 are correct, one is incorrect; the 1 seems to be the issue.
  9. Mark-

    TStyleManager.ActiveStyle...

    See the examples above. Correct as in the color returned is the same, or not, as the color of the window.
  10. Mark-

    TStyleManager.ActiveStyle...

    Thanks for the response. The issue is: bgColor:=actStyle.GetStyleColor(scWindow); returns the correct color for all styles I tested, 10 or so, except one, "Windows".
  11. Mark-

    TStyleManager.ActiveStyle...

    Thanks for the response Remy. OK I can trim down the code. The text is drawn on a TCustomPanel. I am creating the dialog to replace MessageDlg. Styling is the last test. What confuses me is TUxThemeStyle.DoGetStyleColor(scWindow) works for all styles I tested, 10 or so, except one, "Windows". So, I will test with using another selector. I tested all the selectors, above, with Ruby Graphite and all returned the wrong color: Interesting...
  12. Mark-

    What .PAS file does a form use?

    Then, unless I am more confused, fRepCompEnrolment is on the same form, in another form declared in a "uses" on the form, or global. And "CTRL" left clicking on fRepCompEnrolment, in the IDE does nothing?
  13. Mark-

    What .PAS file does a form use?

    Then put a break point in the form button. I am confused how you know where the "report" is launched from and cannot find the "report" unit from the calling location.
  14. Mark-

    What .PAS file does a form use?

    Using search, search all files in the project for the reporter component name and the unusual file name will be it.
  15. OK. > but I don't receive any messages like I see in MQTT Explorer. Is it the lack of a confirmation the subscribe was successful? or Is the value in the server changing and you are not being notified?
  16. Did you receive a SUBACK response when you subscribed?
  17. Or at the bottom right:
  18. Mark-

    Alignment of group of controls

    I would guess at or near the bottom of the object inspector.
  19. Hello, The Wiki page https://wiki.overbyte.eu/wiki/index.php/TWSocket Addr Client: The host to connect to. Server: The interface to listen on. LocalAddr The local address to which the socket is bound. Is this true for TCP and UDP? For a client, Addr is the remote (host) address and LocalAddr, if specified, is the interface to bind the socket. For a server, Addr specifies the interface to listen on so LocalAddr is not used. Mark
  20. Mark-

    UDP bind...

    Thanks. Industrial application, lots of networks, binding is necessary in some instances.
  21. Mark-

    UDP bind...

    Using UDP, how to bind the socket to a NIC or other interface device? > For UDP client, TWSocket LocalAddr and LocalPort may be set but are usually left blank,... Does that bind the socket (UDP) to the NIC or whatever the interface device type? I am trying to make sure I understand, for what I am trying to accomplish, and I want to update the Wiki with more data.
  22. Mark-

    UDP bind...

    Thanks for the response. So, for a UDP server, setting the addr is the interface address and LocalAddr is ignored? For a UDP client, how to bind the socket to an interface device? Using LocalAddr? Mark
  23. Hello, Delphi 10.2.3, (VCL) current version of ICS (V9.4). Testing to verify I caught and handled the issue of the customer entering a bad IP address for binding. The IP address is formatted correctly, just not a valid IP address for any present interface. I was using the OnError callback. Call connect, onError is called but, "LastError" was zero. Switched to catching it as an exception try Connect except end; LastError is still zero. Looked in the source at procedure TCustomWSocket.BindSocket; ... if WSocket_Synchronized_bind(HSocket, PSockAddrIn(@LocalSockName)^, SockNamelen) <> 0 then begin and the correct error code 10049 (WSAEADDRNOTAVAIL) is present but, it is never assigned to LastError, that I could see. Perhaps there is something different I should be doing. Any ideas? Thanks, Mark
  24. You are correct, thank you.
  25. Thank you Remy. This: WsocketErrorDesc(ESocketException(exceptObject).ErrorCode) works. I am hoping Angus reads the post.
×