erich.wanker Posted May 24, 2019 Share Posted May 24, 2019 Hello .. if i put a TuniScrollbox on Mainform - i can scrollto TOP with Javascript very simple ... UniSession.AddJS(uniScrollbox.JSName+'.getTargetEl().scrollTo(''Top'', 0, true);'); but if the scrollbox is in a TuniFRAME ??? how can i do that ? on Mainform - i have a TuniContainerpanel.name = display (as area for the TuniFrames) the frame is Tf_start = class(TUniFrame) in the frame i have the uniscrollbox called : groundscroller i tested a lot of combinations IN TF_START .. but no luck :-( procedure Tf_start.starte_animation; begin //UniSession.AddJS(groundscroller.JSName+'.getTargetEl().scrollTo("top");'); //UniSession.AddJS('f_start.'+groundscroller.JSName+'.getTargetEl().scrollTo("left");'); //UniSession.AddJS('MainForm.'+groundscroller.JSName+'.getTargetEl().scrollBy(0,0, false);'); //UniSession.AddJS('MainForm.display.'+groundscroller.JSName+'.getTargetEl().scrollTo(''Top'', 0, true);'); i show a frame with: procedure TMainForm.InsertFrame1(Name: string); // NAVIGATION begin if FFrameName1 <> '' then FreeAndNil(FCurrentFrame1); FFrameName1 := Name; FCurrentFrame1 := TUniFrameClass(FindClass(Name)).Create(self); FCurrentFrame1.Align := alClient; FCurrentFrame1.Parent := display; end; 2 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2019 Share Posted May 24, 2019 Hello Erich, Can you make a simple testcase for this? Quote Link to comment Share on other sites More sharing options...
mikromundo Posted May 25, 2019 Share Posted May 25, 2019 I´m using FRAMES too... When open in RESPONSIVE test, don´t show the SCROLL BARs. How can I put then ? ScrollBox or other way ? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted May 27, 2019 Author Share Posted May 27, 2019 Hello Sherzod ... found the solutio... ThanX for offer for help... Hello mikromundo ... nice greetings from Austria. 2 Things: 1. nice UI .. what Font do you use? 2. I found the solution: In Mainform i use now: if FFrameName1 = 'Tf_start' then UniSession.AddJS((MainForm.FCurrentFrame1 as Tf_start).groundscroller.JSName+'.getTargetEl().scrollTo(''Top'', 0, true);'); in Frame - i have a TUniScrollBox .. Align = alClient ... Margins.Right = 20 all components are on this TUniScrollBox ...in some situations (resolution change, screen orientation change..) i must refresh the TUniScrollBox ... and in this case where is a Scrollto TOP VERY important .. and now it works.. Nice to hear from you about your used Fontname ;-) ThanX Erich Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted May 27, 2019 Share Posted May 27, 2019 4 minutes ago, erich.wanker said: Olá Sherzod ... encontrei a solutio ... ThanX para oferta de ajuda ... Olá mikromundo ... boas saudações da Áustria. 2 coisas: 1. boa interface do usuário .. o tipo de letra que você usa? 2. Eu encontrei a solução: Em Mainform eu uso agora: if FFrameName1 = 'Tf_start' então UniSession.AddJS ((MainForm.FCurrentFrame1 como Tf_start) .groundscroller.JSName + '. GetTargetEl (). ScrollTo (' 'Top' ', 0, true);'); no quadro - eu tenho um TUniScrollBox .. Alinhar = alClient ... Margins.Right = 20 todos os componentes estão neste TUniScrollBox ... em algumas situações (mudança de resolução, mudança de orientação da tela ..) devo atualizar a TUniScrollBox ... e neste caso onde é um Scrollto TOP MUITO importante .. e agora funciona .. É bom saber de você sobre o seu Fontname usado ;-) ThanX Erich I'm interested, can you give me an example? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted May 27, 2019 Author Share Posted May 27, 2019 Hello eduardo .. ice_video_20190527-142351.webm This is a demo User-Interface Works on Desktop, Tablet, mobile... The basic is the Mainform ... and in this form i show a lot of different TuniFrames.. Call a Frame: procedure TMainForm.InsertFrame1(Name: string); // NAVIGATION begin if FFrameName1 <> '' then FreeAndNil(FCurrentFrame1); FFrameName1 := Name; FCurrentFrame1 := TUniFrameClass(FindClass(Name)).Create(self); FCurrentFrame1.Align := alClient; FCurrentFrame1.Parent := display; end; in the TuniFrame i use a TuniSrollbox as parent for all controls.. if i resize the Browser - i start: procedure TMainForm.starte_animation; begin if FFrameName1 = 'Tf_start' then begin (MainForm.FCurrentFrame1 as Tf_start).mein_display.height := 0; UniSession.AddJS((MainForm.FCurrentFrame1 as Tf_start).groundscroller.JSName+'.getTargetEl().scrollTo(''Top'', 0, true);'); end; ... and the animation of the used Panels (Array of Panels) i made with: unisession.AddJS(meine_panels[x].JSName + '.animate({ duration: ' + inttostr(speed) + ', to: { x: ' + inttostr(tx) + ', y: ' + inttostr(ty) + '}});'); Thats all :-) HTH Erich 2 Quote Link to comment Share on other sites More sharing options...
mikromundo Posted May 27, 2019 Share Posted May 27, 2019 Great effect!!! Very nice !!! I´m using theme: triton.modified Quote Link to comment Share on other sites More sharing options...
Tokay Posted May 28, 2019 Share Posted May 28, 2019 On 5/27/2019 at 3:30 PM, erich.wanker said: Thats all :-) Could you please share a demo project? Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted May 29, 2019 Author Share Posted May 29, 2019 Yes - i can .. but i hope (all users who use this...) are also sharing additional ideas, better coding and other functions ;-) .... i suggest this Tread for updates and uploads... Full Version: mo2020.zip Additional Informations: in this version - where is a " new BroadcastChannel" - idea embeeded .. (i am very proud!) I use this technic to communicate between Android-App and UNIGUI .... A Simple Android App (with just a TWebbrowser to show my UniGui-dll) sends - if the user clicks on AndroidHardwareBack - a information via BroadcastChannel to the UniGui-BrowserApp ... the Browser App converst the BroadcastChannel-Information into a Ajax-Event .. and the UniGui reacts on the Ajax-Event Demonstation: The Android App calls my UniGui-dll ... shows it in a TWebBrowser ... and if user clicks on "AndroidHardwareBack" - the uniGui reacts ... (the last click in the video at 0:10 is the "AndroidHardwareBack"-click..) 2019_05_29_13_34_40.mp4 3 Quote Link to comment Share on other sites More sharing options...
Pep Posted May 29, 2019 Share Posted May 29, 2019 Thank you very much to share this code Quote Link to comment Share on other sites More sharing options...
AntonioCuomo Posted May 30, 2019 Share Posted May 30, 2019 Whynot possible download source at http://forums.unigui.com/applications/core/interface/file/attachment.php?id=7138? thank Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 30, 2019 Share Posted May 30, 2019 1 hour ago, acuomo said: Why not possible download source at... Which edition and build of UniGUI are you using? Quote Link to comment Share on other sites More sharing options...
Tokay Posted May 30, 2019 Share Posted May 30, 2019 Thank you for the demo, it works as expected, I'll try to use same approach. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.