Jump to content
Registration disabled at the moment Read more... ×

Renate Schaaf

Members
  • Content Count

    140
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by Renate Schaaf

  1. Renate Schaaf

    How to "dim" a TabSheet?

    As you see, the code I referred to isn't mine, I just found it useful. But let me try 🙂 Edit: The short answer seems to be that it isn't supported. When one tries to remove the layered style from the child controls of the panel they either get invisible or one gets a Win-Error. For the long answer I guess you have to go back to your bitmap-idea. This: https://www.codeguru.com/csharp/csharp/cs_controls/tutorials/article.php/c12323/Creating-NonTransparent-Controls-on-a-SemiTransparent-Window.htm is old, but looks good.
  2. Renate Schaaf

    How to "dim" a TabSheet?

    Hi, You can use the code in https://www.delphipraxis.net/1486219-post6.html to make a TWincontrol (semi)transparent (not just a stringgrid). Use it for a black panel, set its parentbackground to false and alignClient it on the tabsheet. I tried it with Delphi 10.3.3 CE.
  3. Renate Schaaf

    How to compare performance between Delphi versions?

    I have 2006 running on Windows 10. As far as I remember it just worked by using disk images of the install disks and running setup.exe manually. I think I also had to run the .net SDK-setup before, separately.
  4. Renate Schaaf

    What are your compiler settings for debug builds?

    What is the reason for turning optimization off? Are there any pitfalls when having it on? Edit: I remember now, there are problems with the debugger not showing stuff that's optimized out, is that all?
  5. Renate Schaaf

    Browsing for certain files on Android

    All I want is a substitute for an OpenFileDialog on Android, I mean, that can't be so hard, I thought. In particular I want the user to pick a video file and read its file name. I found this https://delphi-developers-archive.blogspot.com/2017/05/delphi-android-get-file-path-of-image.html and modified it a bit, so it either returns a valid file name or else fails: procedure TForm1.BrowseForVideoFile; var Data: Jnet_Uri; Intent: JIntent; begin // fMessageSubscriptionID: integer is a field of TForm1 FMessageSubscriptionID := TMessageManager.DefaultManager.SubscribeToMessage (TMessageResultNotification, HandleActivityMessage); Intent := TJIntent.Create; Intent.setType(StringToJString('video/*')); Intent.setAction(TJIntent.JavaClass.ACTION_GET_CONTENT); MainActivity.startActivityForResult(Intent, 0); end; // when message is received procedure TForm1.HandleActivityMessage(const Sender: TObject; const M: TMessage); begin if M is TMessageResultNotification then if HandleIntentAction(TMessageReceivedNotification(M).Value) then begin // A valid filename has been returned // Do The Videofile processing end; Edit2.text := fVideoFilename; end; // This retrieves the file name the user picked, but reliably only if done per // opening MyDocuments function TForm1.HandleIntentAction(const Data: JIntent): Boolean; var P: TJavaObjectArray<Jstring>; // in case you want only specific fields... not used here. I have passed nil to get all the columns. C: JCursor; I: integer; begin P := nil; // The following makes no difference // P:=TJavaObjectArray<Jstring>.create(1); // P.Items[0]:=StringToJstring('_data'); // this is suppose to give the information back to C ( : JCursor) C := MainActivity.getContentResolver.query(Data.getData, nil, // when projection is nil... it returns all columns. Ideally, you should only ask for the columns you need StringToJString(''), // java accepts nil... but you cannot give nil here, you need to give an empty JString nil, StringToJString('')); // java accepts nil... but you cannot give nil here, you need to give an empty JString C.moveToFirst; Result := false; for I := 0 to C.getColumnCount - 1 do begin if JStringToString(C.getColumnName(I)) = '_data' then // '_data' column contains the path... you can use this to create the filestream to upload or do whatever.... begin // fVideoFilename is a field of the form fVideoFilename := JStringToString(C.getString(I)); Result := true; Break; end; end; if not Result then fVideoFilename := ''; // P.Free; end; My problem is, that this offers way too many browsers for the user to choose from, when all that really works is browsing MyDocuments. What is the right approach to limit the browsers to MyDocuments? Or is there an easier way to begin with? Thanks for reading, Renate
  6. Renate Schaaf

    Browsing for certain files on Android

    Yet another hoop to jump through.. Why are they making it so hard? Thanks for the link, I'll check it out. Renate
  7. Just bought it for those sleepless nights, Thanks!! Renate
  8. Renate Schaaf

    Browsing for certain files on Android

    Please excuse my lack of knowledge here, I'm just starting to work with this Android stuff. I guess so. Well, I think I know how to do this, but that wouldn't help the user to pick to right video file, I need the thumbnails. By browers I mean that every app that processes the file type gets displayed at the top of the window that opens. For example Google fotos, Samsung gallery, ... I just want to open the documents folder ("Eigene Dateien" in my German tablet).
  9. That's my limited impression after a break of 12 years from Delphi. I paid for all versions up to 2006, now I'm using the community edition, and I am grateful for having the chance this way to come up to par with the new stuff, so I'm a bit reluctant to bash them. I answered here because of general interest in component design, not because I'm particularly interested in this component. This looks good, I have it tagged.
  10. I didn't dare to say that, but that's what I thought:) Now I wonder whether there is a way to make this safe short of changing the source code or writing a wrapper component with a TNetHTTPClient as a subcomponent and exposing its things as needed, which seems to be a lot of work.
  11. I'm a bit puzzled here, because usually it is a big no-no to assign code to a published event in a descendant component. Because the event is still published and anybody using your component can assign something else to this event and your added functionality is gone. Usually you should override the method which calls the event, add the functionality and call inherited. Only: Looking at the source code I see that this method (DoReceiveData) is both private and not virtual, so there's no chance to do it this way. I wonder whether there's a reason the Delphi developers did it that way, or why have they abandoned the usual component design patterns? Anyway, I would at least unpublish these events, along the lines in https://stackoverflow.com/questions/53677049/hide-properties-and-events-in-new-component
×