Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   ShowModal und Show in Firemonkey Android App (https://www.delphipraxis.net/181847-showmodal-und-show-firemonkey-android-app.html)

wschrabi 12. Sep 2014 07:41

ShowModal und Show in Firemonkey Android App
 
HI,
Ich hab das gelesen: http://docwiki.embarcadero.com/RADSt...en_Plattformen und auch das: http://docwiki.embarcadero.com/Libra...Form.ShowModal trozdem komme ich mit ShowModal nicht klar.

Generell stellt sich nur die Frage, wie kann ich von einem FORM ein anderes Form aufrufen und darstellen und dieses nach 2 sec wieder autom. schliessen lassen und die Steuerung wieder auf FORM1 zurückgibt.
Kann mir da jemand helfen?
DANKE

Mavarik 12. Sep 2014 09:33

AW: ShowModal und Show in Firemonkey Android App
 
Ja klar!

Showmodal := 'Schlecht!';

Ein Form zu Erzeugen und diese wieder zu schließen macht für mich erst mal keinen Sinn.

Du willst doch sicherlich "nur" etwas anzeigen, oder?

Da kannst Du auch einfach ein Layout/Rechtangle/Panel "drüber" legen!

Mavarik

ExceptionOverflow 12. Sep 2014 15:27

AW: ShowModal und Show in Firemonkey Android App
 
Hallo,

ich habe zwar noch nie mit Firemonkey oder Android gearbeitet aber mal so als kleiner Tipp (zumindest habe ich diese Erfahrung bei Windows Phone gemacht): Du solltest die mobilen Anwendungen nicht als Windows Anwendungen betrachten. Bei Windows benutzt du wie der Name schon sagt viele einzelne Fenster um Inhalt gekapselt / gegliedert darzustellen. In der mobilen Entwicklung aber hast du normalerweise nur eine Fläche um etwas darstellen zu können, also musst du die Information auch auf diese eine Fläche platzieren und nicht darin noch ein "Fenster" oder derartiges reinschieben. Das heißt natürlich nicht, dass du kein Popup erstellen sollst - das ist ja manchmal gewünscht oder nötig - aber hier eben anders als du es womöglich gewohnt bist. Du richtest dich am besten nach dem Vorschlag meines Vorposters und erstellst eine Art "overlay" - eine Fläche die darüber angezeigt wird - um den hervorzuhebenden Inhalt darzustellen. :cyclops:

Beste Grüße,

Niclas

mjustin 12. Sep 2014 15:43

AW: ShowModal und Show in Firemonkey Android App
 
Zitat:

Zitat von ExceptionOverflow (Beitrag 1272409)
In der mobilen Entwicklung aber hast du normalerweise nur eine Fläche um etwas darstellen zu können, also musst du die Information auch auf diese eine Fläche platzieren und nicht darin noch ein "Fenster" oder derartiges reinschieben.

Android Oberflächen verwenden mehrere Fenster, die sich übereinander legen und dabei das darunter liegende ganz oder teilweise verdecken. (Bei iOS mag es anders sein ...):

http://developer.android.com/guide/c...ctivities.html

Zitat:

Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
Die geöffneten Fenster kann man sich als eine Art "Stapel" (engl. "Stack") vorstellen, in denen man mit der Back-Taste zurückgehen kann:

Zitat:

The back stack abides to the basic "last in, first out" stack mechanism, so, when the user is done with the current activity and presses the Back button, it is popped from the stack (and destroyed) and the previous activity resumes.
Anders gesagt: auch Windows verwendet nur eine Fläche ;)

wschrabi 13. Sep 2014 13:13

AW: ShowModal und Show in Firemonkey Android App
 
Danke. Hier mein Vorschlag, der nicht funkt.
Wenn man von einem Button_ON die ON routine aufruft, wird das Image angezeigt. MIt Button_Off und die OFF routine aufruft wird das Image nicht angezeigt und die Labels darunter wieder sichtbar.

DOch wenn man Nachfolgend eine InputQuery hat klappt das nicht. Was kann ich machen, damit das Bild vor EIngabe der Messpunkte angezeigt wird?

Delphi-Quellcode:
    for i := 1 to 15 do
      begin
      TaskMP:='';
       ShowMPINfo_on(MPiFolge[i] ,MPlongName[MPFolge[i]]);
       ShowMPINfo_off(MPiFolge[i] ,MPlongName[MPFolge[i]]);
       
       if InputQuery('Bitte Meßdaten vom '+MPlongName[MPFolge[i]]+' eingeben', MPlongName[MPFolge[i]]+' [mm] z.B.: 7,5', TaskMP) and (TaskMP.Trim <> '') then
         begin
         Lipo9Satz.lipo[MPiFolge[i],1]:=StrToFloat(TaskMP);
         end
       else
         begin
         raise Exception.Create('Benutzerabbruch!');
         end;
     
      end;
und hier die ON und OFF routinen.

Delphi-Quellcode:
procedure TFOrm1.ShowMPINFO_ON ( MPNUM: integer; MPName: string);
begin
     Label1.Visible:=false;
     Label2.Visible:=false;
     ListView1.Visible:=False;
     
     Label15.Visible:=false;
     Label16.Visible:=false;
     Label17.Visible:=false;
     Label18.Visible:=false;
     Label19.Visible:=false;
     Label20.Visible:=false;
     Label21.Visible:=false;
     Label22.Visible:=false;
     Label23.Visible:=false;
     Label24.Visible:=false;
     Label25.Visible:=false;
     Label26.Visible:=false;
     Label27.Visible:=false;
     Label28.Visible:=false;
     Label29.Visible:=false;
     
     ImageCOntrolMP.Visible:=True;
     ImageCOntrolMP.Position.X:=8;
     ImageCOntrolMP.Position.Y:=80;
     ImageCOntrolMP.Width := 576;
     ImageCOntrolMP.Height := 435;
//     SetFocused(ImageCOntrolMP);

     SLeep(3000);

procedure TFOrm1.ShowMPINFO_OFF ( MPNUM: integer; MPName: string);
begin
     ImageCOntrolMP.Visible:=false;
     ImageCOntrolMP.Position.X:=568;
     ImageCOntrolMP.Position.Y:=8;
     ImageCOntrolMP.Width := 24;
     ImageCOntrolMP.Height := 24;
     
     ListView1.Visible:=true;
     Label1.Visible:=true;
     Label2.Visible:=true;
     Label15.Visible:=true;
     Label16.Visible:=true;
     Label17.Visible:=true;
     Label18.Visible:=true;
     Label19.Visible:=true;
     Label20.Visible:=true;
     Label21.Visible:=true;
     Label22.Visible:=true;
     Label23.Visible:=true;
     Label24.Visible:=true;
     Label25.Visible:=true;
     Label26.Visible:=true;
     Label27.Visible:=true;
     Label28.Visible:=true;
     Label29.Visible:=true;
 
end;

Mavarik 13. Sep 2014 13:15

AW: ShowModal und Show in Firemonkey Android App
 
Delphi-Quellcode:
Application.Processmessages

wschrabi 14. Sep 2014 14:19

AW: ShowModal und Show in Firemonkey Android App
 
Super! Daran hätt ich nicht gedacht! Tausend Dank. Jetzt klappt es.:-D


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:51 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz