elGringo Posted December 6, 2016 Posted December 6, 2016 Friend asked me to do showcase like that on the picture attached. I'm going to use simple panels on MainPanel. Did anyone create showcases ? How did you do that - maybe on Grid is better? Quote
elGringo Posted December 6, 2016 Author Posted December 6, 2016 Ok, i have done this simple task but i have problem with scroll box... How it works? Can't understand. I add ProductFrames like that uUniShowCaseFrame procedure TUniShowCaseFrame.AddProductFrame; var i:integer; Product:TProductFrame; begin i:=FProductsOL.Add( TProductFrame.Create(Self) ); with TProductFrame(FProductsOL[i]) do begin Parent:=Self; Inc(FNameCount); Name:='SomeName'+FNameCount.ToString; //In which row to put? In current or next? if i>0 then begin if TProductFrame(FProductsOL[i-1]).Left+ 2*TProductFrame(FProductsOL[i-1]).width>FMaxWidth then begin Top:=TProductFrame(FProductsOL[i-1]).Top+ TProductFrame(FProductsOL[i-1]).Height; Left:=0; Self.Height:=Self.Height+TProductFrame(FProductsOL[i-1]).Height; end else begin Top:=TProductFrame(FProductsOL[i-1]).Top; Left:=TProductFrame(FProductsOL[i-1]).Left+ TProductFrame(FProductsOL[i-1]).width; end; end; end; end; I put UniShowCaseFrame on the ScrollBox in MainForm procedure TMainForm.UniFormCreate(Sender: TObject); begin FUniShowCaseFrame:=TUniShowCaseFrame.Create(Self); FUniShowCaseFrame.Parent:=UniScrollBox;// Self; FUniShowCaseFrame.Align:=alClient; FUniShowCaseFrame.MaxWidth:=Self.Width; end; and it does not work... when summary productFrames height is more than ScrollBars height no VerticalScroll Bar appears Quote
Sherzod Posted December 6, 2016 Posted December 6, 2016 Hi, //FUniShowCaseFrame.Align:=alClient; Best regards. Quote
elGringo Posted December 6, 2016 Author Posted December 6, 2016 yes, also found this, thanks ! works perfect Quote
elGringo Posted December 6, 2016 Author Posted December 6, 2016 And how to repaint frame? I paint border on each frame like that on Create procedure TProductFrame.PaintBorder; begin UniCanvas.BitmapCanvas.Pen.Color := $A4A0A0; UniCanvas.BitmapCanvas.MoveTo(5, 5); UniCanvas.BitmapCanvas.LineTo(5, (UniCanvas.Height - 5)); UniCanvas.BitmapCanvas.MoveTo(5, 5); UniCanvas.BitmapCanvas.LineTo(UniCanvas.width - 5, 5); UniCanvas.BitmapCanvas.MoveTo(UniCanvas.width - 5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.LineTo(5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.MoveTo(UniCanvas.width - 5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.LineTo(UniCanvas.width - 5, 5); end; procedure TProductFrame.UniFrameCreate(Sender: TObject); begin // CenterElements; PaintBorder; // <<< UniImageList.GetBitmap(0,Image.Picture.Bitmap); end; But when I create frame no border painted, when I create another one - previous frame has border and so on - see picture I think there sould be way to repaint border Quote
elGringo Posted December 6, 2016 Author Posted December 6, 2016 Simple Example https://yadi.sk/d/Csm5uag032MSJP Quote
Sherzod Posted December 6, 2016 Posted December 6, 2016 Hi, For now try this: uses ... UniGUIJSInterface; procedure TProductFrame.PaintBorder; begin UniCanvas.BitmapCanvas.Pen.Color := $A4A0A0; UniCanvas.BitmapCanvas.MoveTo(5, 5); UniCanvas.BitmapCanvas.LineTo(5, (UniCanvas.Height - 5)); UniCanvas.BitmapCanvas.MoveTo(5, 5); UniCanvas.BitmapCanvas.LineTo(UniCanvas.width - 5, 5); UniCanvas.BitmapCanvas.MoveTo(UniCanvas.width - 5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.LineTo(5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.MoveTo(UniCanvas.width - 5, UniCanvas.Height - 5); UniCanvas.BitmapCanvas.LineTo(UniCanvas.width - 5, 5); IUniJSInterface(UniCanvas).JSCall('submitData', []); // <---------------- end; But, better try to use the style of the border of the panel Best regards. Quote
elGringo Posted December 6, 2016 Author Posted December 6, 2016 Works perfect. First time see that UniGUIJSInterface. Thanks ! Quote
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.