elGringo Posted December 19, 2016 Share Posted December 19, 2016 Hi, all doing like this procedure TProductFrame.PaintUniCanvas; begin if UniCanvas.BitmapCanvas.Brush.Color=$A4A0A0 then UniCanvas.BitmapCanvas.Brush.Color:=clWhite else UniCanvas.BitmapCanvas.Brush.Color:=$A4A0A0; UniCanvas.BitmapCanvas.FillRect( Rect( UniCanvas.Left+5, UniCanvas.Top+5, UniCanvas.Left+UniCanvas.Width-5, UniCanvas.Top+UniCanvas.Height-5 ) ); IUniJSInterface(UniCanvas).JSCall('submitData', []); end; But changes only to one side to $A4A0A0 how to return to origin color? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 19, 2016 Share Posted December 19, 2016 Hi, Better that you will not use "submitData" Otherwise you can try this: procedure TProductFrame.PaintUniCanvas; begin if UniCanvas.BitmapCanvas.Brush.Color=$A4A0A0 then UniCanvas.BitmapCanvas.Brush.Color:=clWhite else UniCanvas.BitmapCanvas.Brush.Color:=$A4A0A0; UniCanvas.BitmapCanvas.FillRect( Rect( UniCanvas.Left+5, UniCanvas.Top+5, UniCanvas.Left+UniCanvas.Width-5, UniCanvas.Top+UniCanvas.Height-5 ) ); UniSession.AddJS('Ext.defer(function(){'+ UniCanvas.JSName +'.submitData()}, 20);'); //<<---------- //IUniJSInterface(UniCanvas).JSCall('submitData', []); //<<---------- end; Best regards. Quote Link to comment Share on other sites More sharing options...
elGringo Posted December 19, 2016 Author Share Posted December 19, 2016 Thanks, decided problem with this procedure TProductFrame.TogglePaintUniCanvas; var index:Integer; begin if FSelectedColor then // Deselecting begin FSelectedColor:=false; UniCanvas.BitmapCanvas.Brush.Color:=FOriginColor; end else // Selecting begin FSelectedColor:=true; UniCanvas.BitmapCanvas.Brush.Color:=$A4A0A0; end; UniCanvas.BitmapCanvas.FillRect( Rect( UniCanvas.Left+5, UniCanvas.Top+5, UniCanvas.Left+UniCanvas.Width-5, UniCanvas.Top+UniCanvas.Height-5 ) ); //IUniJSInterface(UniCanvas).JSCall('submitData', []); end; Also what is initial color of TUniCanVas? 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.