Jump to content

alank2

Members
  • Content Count

    115
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by alank2


  1. I right clicked it and created a custom style.  Then I found the background and edited NormalLink to change where it was pointed to to pointing to the middle of a white box so it would become white.

     

    Are you saying you replaced the background TButtonStyleObject with a TRectangle?

     

    Can the bitmap graphics that NormalLink points to be edited?  What if I wanted to add something to that bitmap?


  2. I've done enough searching to know that it is based on a bitmap; I even remember drilling down and opening a bitmap that looked like the source of how it figures out how to draw controls.

     

    I am creating a number the TSpeedButton's programmatically and I have been using the StyleLookup="buttonstyle" which looks mostly like what I want except it has a grayish background which I need to change to a white background.

     

    What is the easiest way to accomplish that?


  3. I am pretty new to FireMonkey.  What I need is a grid of X wide Y tall buttons that can be clicked.  No scrolling.  Each button needs a couple text labels and a graphic.  I need to build the grid at design time.

     

    I don't mind building the controls dynamically if that is easier.  My original plan was to use a TSpeedButton and put TLabels and an TImage on it.  If I hover over a TLabel, it activates the button, and clicking activates the buttons onclick event not the label's.  TImage does not work the same way however - can it be made to allow hovering to pass through to the button underneath it?

     

    Or is there a better way to go about this?


  4. I created a TSpeedButton and set the StaysPressed property to true.

     

    I then was using IsPressed to see if it is pressed or not in the OnClick event.

     

    If I click it slowly it works, but if I click it quickly, the 2nd time the event is fired (and it does fire), the IsPressed property is not changed, but is the previous state.

     

     

    void __fastcall TTest::UpdateSearch()
    {
    
    //debug does it fire when clicked fast
    static int i1;
    i1++;
    Label1->Text=i1;
    
      if (Search[0]==0)
        {
          if (SBSpecialOnly->IsPressed)
            LSearch->Text="Type to search special";
          else LSearch->Text="Type to search";
          LSearch->FontColor=claDarkgray;
        }
      else
        {
          LSearch->FontColor=claBlack;
          LSearch->Text=Search;
        }
    }

     


  5. Using cppbuilder I can load a PNG file into a TImage, but then I want to merge another PNG file into it using CopyRect.  I think there is some issue with it not being a bitmap that causes it to give an error when I try.  I've tried some searching about this, but didn't really see anything that helped.  Is thee a way to load the PNG, then perform some operation on it that renders it as a bitmap that I can then CopyRect to?


  6. I keep reading this, but I am already have the function wrapped in extern "C" and it still has the underscore.  DId some C compilers use an underscore and others not?

     

    Trying to make sense of this - do I have these right?

     

    Without extern "C", will it be the mangled C++ name with parameter suffix?

     

    With extern "C", will it simply be mangled to have a simple underscore before it.

     

    With extern "C" _and_ generate underscores option off, then it will drop the underscore, but then be incompatible with standard libraries.

     


  7. I made a DEF file and put an EXPORTS section into it and added it to the project.  I also added lines for each function like this:

     

    function=_function

     

    This does produce a DLL, but it has both function names in it now.  function and _function.  Is there a way to remove _function so that only function is present?


  8. The warning is:

     

    [bcc64 Warning] file.cpp(1336): ISO C++11 does not allow conversion from string literal to 'wchar_t *'

     

    It is from:

     

    wchar_t *ConfigurationResultText[]={
      L"No error",
      L"CFGERROR: Unable to create file",
      L"CFGERROR: Unable to open file or file is busy",
      L"CFGERROR: Unable to perform file IO",
      L"CFGERROR: File is not a CFG file",
    };

     

    It seems that if I put (whcar_t*) before each string, that it eliminates the warning.  My question is why?  Doesn't the L"string" already mean it is a wchar_t * ?  Or does the clang compiler see it as something different?  I usually use the classic compiler, but in x64 that is not an option.


  9. Thank you both for the help!!

     

    Angus> If you use the newer TSslHttpRest instead of TSslHttpCli, you don't need TSslContext and can simplify your application considerably. 

     

    Can you elaborate on the things that would be simplified?  Do you mean the way I am using it in code, or the DLL's that need to be included, etc.

     

    Remy>You could use TIdHTTP, but you would merely be substituting one library dependency for another.  Indy is not a "built-in" library, it is a 3rd party library that just happens to be pre-installed in the IDE by default. 

     

    I understand, but at least as I move to newer RAD studio versions, it would move too.

     

    Remy>A true native built-in solution would be to use Embarcadero's own THTTPClient/TNetHTTPClient instead, see Using an HTTP Client and What is the difference between THTTPClient and TNetHTTPClient?. 

     

    Interesting - I didn't know there was another option besides Indy.  Does THTTPClient also support SSL and the type of json submit/receive that I need to do?

     

     


  10. I only have one application that needs to communicate with a web API.  I've been using the ICS TSslHttpCli/TSslContext components to do this, but I wonder if I could have one less library dependency and use the built in TIdHTTP instead.  This is essentially my communication where I am sending some JSON and then getting some JSON returned:

     

    Could TIdHTTP be up for this same task?

     

    
      //set properties
      SslHttpCli->Timeout=300;
      SslHttpCli->SslContext=SslContext;
      SslContext->SslSessionTimeout=300;
      SslHttpCli->ContentTypePost=L"application/json";
      SslHttpCli->ServerAuth=httpAuthNtlm;
    
     
    
      SslHttpCli->SendStream=parms->senddata;
      SslHttpCli->RcvdStream=parms->recvdata;
      SslHttpCli->URL=parms->URL;
      SslHttpCli->Username=parms->Username;
      SslHttpCli->Password=parms->Password;
    
    
      try
        {
          SslHttpCli->Post();
        }
      catch (Exception &exception)
        {
          ExceptionErrorMessage(&exception, NULL, parms->exmsg, 1024);
          delete SslHttpCli;
          goto fail2;
        }
    
    

     

×