picyka Posted December 18, 2021 Share Posted December 18, 2021 Em 15/12/2021 às 9:53 AM, x11 disse: nenhum componente Good morning, I managed to use the component as it is attached in part 1. For me it works. Quote Link to comment Share on other sites More sharing options...
x11 Posted December 18, 2021 Share Posted December 18, 2021 for mobile to? Quote Link to comment Share on other sites More sharing options...
picyka Posted December 18, 2021 Share Posted December 18, 2021 10 minutos atrás, x11 disse: para celular? Ahh no, I just used it alone Quote Link to comment Share on other sites More sharing options...
picyka Posted December 18, 2021 Share Posted December 18, 2021 1 hour ago, x11 said: for mobile to? no, desktop Quote Link to comment Share on other sites More sharing options...
x11 Posted December 19, 2021 Share Posted December 19, 2021 there is no color select component for mobile Quote Link to comment Share on other sites More sharing options...
stas Posted December 19, 2021 Share Posted December 19, 2021 5 hours ago, x11 said: there is no color select component for mobile https://docs.sencha.com/extjs/7.1.0/modern/Ext.ux.colorpick.Field.html You can wrote this component someself, after that, please publish. Thanks. Quote Link to comment Share on other sites More sharing options...
x11 Posted December 19, 2021 Share Posted December 19, 2021 no i don't know how Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2022 Author Share Posted January 29, 2022 On 10/3/2021 at 11:43 PM, Sherzod said: Limitations: procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject); begin FormatSettings.DecimalSeparator := '.'; end; Removing this dependency: initialization UniAddCSSLibrary('build/packages/ux/classic/classic/resources/ux-all.css', False, [upoFolderJS, upoPlatformDesktop]); UniAddJSLibrary('build/packages/ux/classic/ux.js', False, [upoFolderJS, upoPlatformDesktop]); UniAddJSLibrary('xx.js', False, [upoFolderFiles]); //<------------- xx.js: Ext.ux.colorpick.ColorUtils.parseColor = function(d, g) { if (!d) { return null } var e = this, f = e.colorMap[d], b, c, h; if (f) { c = { r: f[0], g: f[1], b: f[2], a: 1 } } else if (d === 'transparent') { c = { r: 0, g: 0, b: 0, a: 0 } } else { b = e.hexRe.exec(d); if (b) { b = b[1]; switch (b.length) { default: return null; case 3: c = { r: parseInt(b[0] + b[0], 16), g: parseInt(b[1] + b[1], 16), b: parseInt(b[2] + b[2], 16), a: 1 }; break; case 6: case 8: c = { r: parseInt(b.substr(0, 2), 16), g: parseInt(b.substr(2, 2), 16), b: parseInt(b.substr(4, 2), 16), a: parseInt(b.substr(6, 2) || 'ff', 16) / 255 }; break; } } else { b = e.rgbaRe.exec(d); if (b) { c = { r: parseFloat(b[1]), g: parseFloat(b[2]), b: parseFloat(b[3]), a: parseFloat(b[4]) } } else { b = e.rgbaAltRe.exec(d); if (b) { c = e.parseColor(b[1]); c.a = parseFloat(b[2]); return c } b = e.rgbRe.exec(d); if (b) { c = { r: parseFloat(b[1]), g: parseFloat(b[2]), b: parseFloat(b[3]), a: 1 } } else { return null } } } } if (g) { //c.a = Ext.util.Format.number(c.a, g); c.a = c.a.toFixed(2); } h = this.rgb2hsv(c.r, c.g, c.b); return Ext.apply(c, h) } I think this is enough and it won't affect other parts of the framework that use this method. 1 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 17 hours ago, Sherzod said: Removing this dependency: Quote Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 initialization RegisterServerModuleClass(TUniServerModule); UniAddJSLibrary('colorpickext.js', False, [upoFolderFiles]); file exists colorpickext.js Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2022 Author Share Posted January 30, 2022 3 hours ago, x11 said: 3 hours ago, x11 said: initialization RegisterServerModuleClass(TUniServerModule); UniAddJSLibrary('colorpickext.js', False, [upoFolderFiles]); Make sure this file is loaded after ux.js Quote Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 procedure LoadColorpickExt; begin UniAddCSSLibrary('build/packages/ux/classic/classic/resources/ux-all.css', False, [upoFolderJS, upoPlatformDesktop]); UniAddJSLibrary('build/packages/ux/classic/ux.js', False, [upoFolderJS, upoPlatformDesktop]); UniAddJSLibrary('colorpickext.js', False, [upoFolderFiles]); end; initialization RegisterServerModuleClass(TUniServerModule); LoadColorpickExt; Quote Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 there are no errors in log-file on start application Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2022 Author Share Posted January 30, 2022 I will check it again. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2022 Author Share Posted January 30, 2022 2 hours ago, x11 said: UniAddJSLibrary('colorpickext.js', False, [upoFolderFiles]); Sorry, it seems I forgot to include upoPlatformDesktop as well: UniAddJSLibrary('colorpickext.js', False, [upoFolderFiles, upoPlatformDesktop]); And just in case, I changed the script colorpickext.js (added Ext.onReady😞 Ext.onReady(function() { Ext.ux.colorpick.ColorUtils.parseColor = function(d, g) { if (!d) { return null } var e = this, f = e.colorMap[d], b, c, h; if (f) { c = { r: f[0], g: f[1], b: f[2], a: 1 } } else if (d === 'transparent') { c = { r: 0, g: 0, b: 0, a: 0 } } else { b = e.hexRe.exec(d); if (b) { b = b[1]; switch (b.length) { default: return null; case 3: c = { r: parseInt(b[0] + b[0], 16), g: parseInt(b[1] + b[1], 16), b: parseInt(b[2] + b[2], 16), a: 1 }; break; case 6: case 8: c = { r: parseInt(b.substr(0, 2), 16), g: parseInt(b.substr(2, 2), 16), b: parseInt(b.substr(4, 2), 16), a: parseInt(b.substr(6, 2) || 'ff', 16) / 255 }; break; } } else { b = e.rgbaRe.exec(d); if (b) { c = { r: parseFloat(b[1]), g: parseFloat(b[2]), b: parseFloat(b[3]), a: parseFloat(b[4]) } } else { b = e.rgbaAltRe.exec(d); if (b) { c = e.parseColor(b[1]); c.a = parseFloat(b[2]); return c } b = e.rgbRe.exec(d); if (b) { c = { r: parseFloat(b[1]), g: parseFloat(b[2]), b: parseFloat(b[3]), a: 1 } } else { return null } } } } if (g) { //c.a = Ext.util.Format.number(c.a, g); c.a = c.a.toFixed(2); } h = this.rgb2hsv(c.r, c.g, c.b); return Ext.apply(c, h) } }) 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted January 30, 2022 Share Posted January 30, 2022 Thanks a lot, that's how it works. It remains to be done to make a mobile component. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2022 Author Share Posted January 30, 2022 3 minutes ago, x11 said: It remains to be done to make a mobile component. Okay. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 6, 2022 Author Share Posted February 6, 2022 On 1/30/2022 at 7:55 PM, x11 said: It remains to be done to make a mobile component. In the process, but there are also some nuances. 1 Quote Link to comment Share on other sites More sharing options...
Point Posted March 3, 2022 Share Posted March 3, 2022 Hi @Sherzod, i got error when compile this line, procedure TUniColorComboBox.LoadCompleted; begin inherited; SetDomStyleCSSProperty('z-index', '10', '.x-colorpicker-field-swatch'); SetDomStyleCSSProperty('left', '2px', '.x-colorpicker-field-swatch'); SetDomStyleCSSProperty('width', FColorWidth, '.x-colorpicker-field-swatch'); --> JSAddElEvent('click', 'swatchEl', ['this'], 'this.component.onTriggerClick()', nil, JSControl); . . . end; No error when i change with this : JSAddElEvent('click', 'swatchEl', ['this'], 'this.component.onTriggerClick()'); may i change it like that? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 3, 2022 Author Share Posted March 3, 2022 6 minutes ago, Point said: i got error when compile this line, Hello, What error are you getting? Quote Link to comment Share on other sites More sharing options...
Point Posted March 3, 2022 Share Posted March 3, 2022 [dcc32 Error] uColorComboBox.pas(110): E2250 There is no overloaded version of 'JSAddElEvent' that can be called with these arguments Quote Link to comment Share on other sites More sharing options...
Point Posted March 3, 2022 Share Posted March 3, 2022 Should i use unigui new release version ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 3, 2022 Author Share Posted March 3, 2022 45 minutes ago, Point said: Should i use unigui new release version ? Well, if possible, you should always try to use the latest builds... Quote Link to comment Share on other sites More sharing options...
Point Posted March 3, 2022 Share Posted March 3, 2022 I will try using the new release. but I already installed it. what are the consequences if I don't use the new release. Will it result in a fatal error? like a memory leak or something else? Quote Link to comment Share on other sites More sharing options...
Point Posted March 3, 2022 Share Posted March 3, 2022 it's seem working fine on 1555. with above condition. 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.