dbf_usr Posted April 21, 2022 Share Posted April 21, 2022 Как отцентрировать изображение в UniBitBtn? IconAling=iaTop изображение сверху но не по центру. Всем за ранее благодарен! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 22, 2022 Share Posted April 22, 2022 10 hours ago, dbf_usr said: Здравствуйте, Что за изображение? Как Вы присваиваете изображение? Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 22, 2022 Author Share Posted April 22, 2022 2 hours ago, Sherzod said: Здравствуйте, Что за изображение? Как Вы присваиваете изображение? UniBitBtn1.ImageIndex:=0; UniBitBtn1.Caption:='Тестовая кнопка <br> тест второй строки'; Использую: UniNativeImageList Но даже если картинку загрузить сразу в кнопку: UniBitBtn1.Glyph то результат такой же. Картинка по центру только если удалить весь текст, но мне это не подходит - нужна подпись картинки. Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 22, 2022 Author Share Posted April 22, 2022 3 hours ago, Sherzod said: Здравствуйте, Что за изображение? Как Вы присваиваете изображение? При динамичном создании тоже самое: with TUniBitBtn(InsertControl(TUniBitBtn.Create(Self))) do begin Left:=8; Top:=113+8; Height:=113; Width:=200; //LayoutConfig.cls:='boton_white'; Font.Color:=clHighlight; Text:='Text'; IconAlign:=iaTop; Images:=UniNativeImageList1; ImageIndex:=1; Caption:='Тестовая кнопка <br> тест второй строки<br>'+Name; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 22, 2022 Share Posted April 22, 2022 Можете прикрепить пример? Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 22, 2022 Author Share Posted April 22, 2022 1 hour ago, Sherzod said: Можете прикрепить пример? Test_ERR.zip Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 22, 2022 Author Share Posted April 22, 2022 1 hour ago, Sherzod said: Можете прикрепить пример? И еще вопрос, не работает строка: LayoutConfig.cls:='boton_white'; Подскажите как правильно указать этот параметр? with TUniBitBtn(InsertControl(TUniBitBtn.Create(Self))) do begin Left:=8; Top:=113+8; Height:=113; Width:=200; LayoutConfig.cls:='boton_white'; Font.Color:=clHighlight; Text:='Text'; IconAlign:=iaTop; Images:=UniNativeImageList1; ImageIndex:=1; Caption:='Тестовая кнопка <br> тест второй строки<br>'+Name; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 22, 2022 Share Posted April 22, 2022 Чуть позже попробую проанализировать. Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 23, 2022 Share Posted April 23, 2022 On 4/22/2022 at 3:08 PM, dbf_usr said: Test_ERR.zip 66.91 kB · 0 downloads PgDataSource1: TPgDataSource; PgConnection1: TPgConnection; ? Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 23, 2022 Author Share Posted April 23, 2022 1 hour ago, Sherzod said: PgDataSource1: TPgDataSource; PgConnection1: TPgConnection; ? они не нужны. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 26, 2022 Share Posted April 26, 2022 On 4/23/2022 at 5:39 PM, dbf_usr said: они не нужны. 1. Config: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniBitBtn1.JSInterface.JSConfig('cls', ['customIcon']); end; 2. CustomCSS: .customIcon .x-btn-icon-el { width: auto !important; } Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 26, 2022 Author Share Posted April 26, 2022 2 hours ago, Sherzod said: 1. Config: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniBitBtn1.JSInterface.JSConfig('cls', ['customIcon']); end; 2. CustomCSS: .customIcon .x-btn-icon-el { width: auto !important; } СПАСИБО!!!! 1 Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 26, 2022 Author Share Posted April 26, 2022 4 hours ago, Sherzod said: 1. Config: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniBitBtn1.JSInterface.JSConfig('cls', ['customIcon']); end; 2. CustomCSS: .customIcon .x-btn-icon-el { width: auto !important; } Подскажите еще пожалуйста как добавить к .customIcon .x-btn-icon-el это: background:#FFFFFF !important; color:#FFFFFF !important; Нужно кнопку сделать белой За ранее благодарен Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 27, 2022 Share Posted April 27, 2022 Аналогичный пост: Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 28, 2022 Author Share Posted April 28, 2022 On 4/27/2022 at 11:57 AM, Sherzod said: Аналогичный пост: Ошибка. Возможно я не правильно воспользовался Вашим решением. Прошу поправить меня. За ранее благодарен! with TUniBitBtn(InsertControl(TUniBitBtn.Create(Self))) do Begin Name:= 'UniBitBtn'+inttostr(i); Left:=L; //179 - вторая колонка 169+10=179 Top:=T; // 100 - втoрой ряд 89+11=100 Height:=89; Width:=169; Font.Color:=clWhite; Text:='Text'; IconAlign:=iaTop; Images:=UniNativeImageList1; ImageIndex:=-1; Caption:='Тестовая кнопка <br> тест второй строки <br> '+Name; JSInterface.JSConfig('cls', ['customIcon']); with UniBitBtn1.JSInterface do begin JSCall('btnWrap.setStyle', ['background-image', 'linear-gradient(to right, green, lime)']); JSCall('btnWrap.setStyle', ['background-repeat', 'no-repeat']); end; End; Ошибка. Возможно я не правильно воспользовался Вашим решением. Прошу поправить меня. За ранее благодарен! 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.