yakup Posted March 10, 2023 Share Posted March 10, 2023 Merhabalar, Uygulamada minik widgetler kullanıyorum, rapor gibi. bu widgetler panel içerisinde, Panel ise draggable modunda. Kullanıcı istediği yere sürükleyip bırakabiliyor hizalayabiliyor. Hizalama sonrası pozisyonları coockie kaydediyorum. Aynı kullanıcı yeniden oturum açınca ilgili panellerin, Kullanıcın daha önce ayarladığı önceki konumlarını coockie den okuyup atamasını yapıyorum (Main.Onshow'da) Ancak Panel o konuma gelmiyor. Sanırım biraz gecikmeli yapsam olur deyip Timer koydum Runonce modunda, MainForm onshow olayında timer çalıştırıp konumları setleyince bu resimdeki hata dönüyor. Ama ekrana bir buton koyup, Timeri o buton içinde start edersem paneller olması gereken konumlara geçiyor. Veya Timer aradan çıkarıp bir butonla atama yaparsam yine paneller istediğim pozisyona geliyor. Kısaca panelin yeniden konumlanmaları için illaki bir butonla tetiklemek gerekiyor. Burada nasıl bir mantık kurabilirim panellerin pozisyonlarını oturum açıldığında nasıl değiştirebilirim. Konumlanma procedure içi, DragPanel1.Left := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel1_L'), 5); DragPanel1.Top := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel1_T'), 15); DragPanel2.Left := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel2_L'), 25); DragPanel2.Top := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel2_T'), 200); DragPanel3.Left := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel3_L'), 25); DragPanel3.Top := StrToIntDef(UniApplication.Cookies.GetCookie ('DragPanel3_T'), 200); Quote Link to comment Share on other sites More sharing options...
yakup Posted March 10, 2023 Author Share Posted March 10, 2023 Ek olarak runtime'da panel boyutunu sürükleyerek uzatmakda istiyorum yapabilir miyiz ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 10, 2023 Share Posted March 10, 2023 39 minutes ago, yakup said: Ek olarak runtime'da panel boyutunu sürükleyerek uzatmakda istiyorum yapabilir miyiz ? Specify your case please. And what's the issue at the moment? Quote Link to comment Share on other sites More sharing options...
yakup Posted March 10, 2023 Author Share Posted March 10, 2023 3 minutes ago, Sherzod said: Specify your case please. And what's the issue at the moment? First message Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 10, 2023 Share Posted March 10, 2023 1 hour ago, yakup said: First message I will try to check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 10, 2023 Share Posted March 10, 2023 @yakup Are you using AlignmentControl = uniAlignmentServer ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 10, 2023 Share Posted March 10, 2023 One of the possible solutions: 1. function beforeInit(sender, config) { Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider')); config.stateId = 'uniqueNamePanel'; //Must assign a unique stateId config.stateful = true; //Optional } 2. function move(sender, x, y, eOpts) { Ext.defer(function() { var props = { x: sender.x, y: sender.y }; Ext.state.Manager.set(sender.stateId + "Props", props); }, 1000) } 3. function boxready(sender, width, height, eOpts) { var props = Ext.state.Manager.get(sender.stateId + "Props"); if (props) { sender.setPosition([props.x, props.y]) } } Quote Link to comment Share on other sites More sharing options...
yakup Posted March 13, 2023 Author Share Posted March 13, 2023 On 3/10/2023 at 8:12 PM, Sherzod said: @yakup Are you using AlignmentControl = uniAlignmentServer ? Yes. Quote Link to comment Share on other sites More sharing options...
yakup Posted March 13, 2023 Author Share Posted March 13, 2023 On 3/10/2023 at 9:10 PM, Sherzod said: One of the possible solutions: 1. function beforeInit(sender, config) { Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider')); config.stateId = 'uniqueNamePanel'; //Must assign a unique stateId config.stateful = true; //Optional } 2. function move(sender, x, y, eOpts) { Ext.defer(function() { var props = { x: sender.x, y: sender.y }; Ext.state.Manager.set(sender.stateId + "Props", props); }, 1000) } 3. function boxready(sender, width, height, eOpts) { var props = Ext.state.Manager.get(sender.stateId + "Props"); if (props) { sender.setPosition([props.x, props.y]) } } it work, thank you 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.