MSMK Posted September 18, 2020 Share Posted September 18, 2020 Асалаумағалейкум! Можно ли программным методом добавить кнопку TUniButton в панельку с табами? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 18, 2020 Share Posted September 18, 2020 30 minutes ago, =GGG= said: Асалаумағалейкум! Можно ли программным методом добавить кнопку TUniButton в панельку с табами? Здравствуйте, Попробуем проанализировать. Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 1 minute ago, Sherzod said: Здравствуйте, Попробуем проанализировать. получилось используя css, костылеобразным способом. Хотелось бы более правильно Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 18, 2020 Share Posted September 18, 2020 1 minute ago, =GGG= said: получилось используя css, костылеобразным способом. Можете поделиться скрином? Quote Link to comment Share on other sites More sharing options...
x11 Posted September 18, 2020 Share Posted September 18, 2020 2 hours ago, =GGG= said: получилось Ну если не сложно, можно было бы и поделиться примерами вдруг кому-то пригодится, кто-то сможет улучшить Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 18, 2020 Share Posted September 18, 2020 57 minutes ago, x11 said: вдруг кому-то пригодится procedure TMainForm.UniFormReady(Sender: TObject); begin with UniPageControl1.JSInterface do begin JSCode(#1'.tabPanel.tabBar.add({xtype: "tbfill"});'); JSCall('tabPanel.tabBar.add', [UniButton1.JSControl]); //UniButton1 in HiddenPanel end; end; 1 Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 31 minutes ago, Sherzod said: procedure TMainForm.UniFormReady(Sender: TObject); begin with UniPageControl1.JSInterface do begin JSCode(#1'.tabPanel.tabBar.add({xtype: "tbfill"});'); JSCall('tabPanel.tabBar.add', [UniButton1.JSControl]); //UniButton1 in HiddenPanel end; end; Рахмет! Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 31 minutes ago, Sherzod said: procedure TMainForm.UniFormReady(Sender: TObject); begin with UniPageControl1.JSInterface do begin JSCode(#1'.tabPanel.tabBar.add({xtype: "tbfill"});'); JSCall('tabPanel.tabBar.add', [UniButton1.JSControl]); //UniButton1 in HiddenPanel end; end; то что нужно! Quote Link to comment Share on other sites More sharing options...
x11 Posted September 18, 2020 Share Posted September 18, 2020 ну так а к JS-кнопке нужно еще какой-то код прикрутить? Как? Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 6 minutes ago, x11 said: ну так а к JS-кнопке нужно еще какой-то код прикрутить? Как? просто обработчик по клику кнопке напишите 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted September 18, 2020 Share Posted September 18, 2020 ааа, т.е. UniButton1 просто кинуть куда-нибудь на форму и всё? Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 Just now, x11 said: ааа, т.е. UniButton1 просто кинуть куда-нибудь на форму и всё? на форму кидаете UniHiddenPanel1, в нее кнопку. Все контролы в ней не видимы Quote Link to comment Share on other sites More sharing options...
MSMK Posted September 18, 2020 Author Share Posted September 18, 2020 JSCall('tabPanel.tabBar.add', [UniButton1.JSControl]); //UniButton1 in HiddenPanel Шерзод тут подсказал в комменте Quote Link to comment Share on other sites More sharing options...
x11 Posted September 18, 2020 Share Posted September 18, 2020 7 minutes ago, =GGG= said: на форму кидаете UniHiddenPanel1 1 hour ago, =GGG= said: //UniButton1 in HiddenPanel мдаа... в пятницу уже совсем голова не варит, нужно отдохнуть немножко спасибо 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.