Beispiel #1
0
        protected override void OnExpose(object o, ExposeEventArgs args)
        {
            using(Cairo.Context cr = Gdk.CairoHelper.Create(GdkWindow)){
                // make the background white with a line around
                double x = 0;
                double y = 0;
                double w = Allocation.Width-settings.SectionWidth;
                double h = Allocation.Height-settings.SectionHeight;
                Pango.Layout pl = new Pango.Layout(this.PangoContext);

                DrawPaper(cr,x,y,w,h);

                ArrayList labels = new ArrayList();
                for(int i=0;i < settings.PageLayout.LabelsPerPage;++i){
                    labels.Add( new PseudoLabelRenderer() );
                }

                GetInnerRegion(ref x,ref y,ref w,ref h);

                PageLayout layout = new PageLayout();
                layout.LabelRepeatX = settings.PageLayout.LabelRepeatX;
                layout.LabelRepeatY = settings.PageLayout.LabelRepeatY;
                layout.PaddingX = settings.PageLayout.PaddingX;
                layout.PaddingY = settings.PageLayout.PaddingY;
                layout.LabelWidth = (w-2*layout.PaddingX-settings.LabelPadding*(layout.LabelRepeatX-1)) / layout.LabelRepeatX;
                layout.LabelHeight = (h-2*layout.PaddingY-settings.LabelPadding*(layout.LabelRepeatY-1)) / layout.LabelRepeatY;

                PageRenderer pr = new PageRenderer(labels,layout);
                pr.Render(cr,pl,x,y,w,h);

                //double nn;
                //DrawVerticalSectionIndicator(settings.PageLayout.LabelRepeatY.ToString()+"x",cr,pl,x+w+sectionPadding,y,out nn,h);
                //DrawHorizontalSectionIndicator(settings.PageLayout.LabelRepeatX.ToString()+"x",cr,pl,x,y+h+sectionPadding,w,out nn);
            }
        }
Beispiel #2
0
 public Page(ArrayList labels, PageLayout layout)
 {
     Layout = layout;
     Labels = labels;
 }