Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

r - pushViewport -> layout.pos.col possible with doubles? -


i wondering if possible specify grid viewports double this:

pushviewport(viewport(layout.pos.row=1, layout.pos.col=1.5)) popviewport()  

when i'm trying row 1 , col 1.

but want have half of col 1 , half of col 2.

has hint me?

probably cannot layout.pos.row , layout.pos.col. simple workaround specify position , size:

grid.newpage() pushviewport(viewport(layout=grid.layout(2, 2))) grid.rect(gp=gpar(fill=1),vp=viewport(layout.pos.col=1,layout.pos.row=1)) grid.rect(gp=gpar(fill=2),vp=viewport(layout.pos.col=1,layout.pos.row=2)) grid.rect(gp=gpar(fill=3),vp=viewport(layout.pos.col=2,layout.pos.row=1)) grid.rect(gp=gpar(fill=4),vp=viewport(layout.pos.col=2,layout.pos.row=2))  pushviewport(viewport(x=unit(0.5, "npc"), width=unit(0.5, "npc"),    y=unit(0.75, "npc"), height=unit(0.5, "npc"))) grid.rect(gp=gpar(fill="white")) 

also, think can write wrapper function specifying pos.col , pos.row in double, this:

vpvp <- function(pos.col, pos.row){   cvp <- current.viewport()   nrow <- cvp$layout$nrow   ncol <- cvp$layout$ncol   w <- unit(1/ncol, "npc")   h <- unit(1/nrow, "npc")   x <- unit((pos.col-0.5)/ncol, "npc")   y <- unit(1-(pos.row-0.5)/nrow, "npc")   viewport(x=x, y=y, width=w, height=h) }  grid.newpage() pushviewport(viewport(layout=grid.layout(2, 3))) grid.rect(gp=gpar(fill=1),vp=viewport(layout.pos.col=1,layout.pos.row=1)) grid.rect(gp=gpar(fill=2),vp=viewport(layout.pos.col=1,layout.pos.row=2)) grid.rect(gp=gpar(fill=3),vp=viewport(layout.pos.col=2,layout.pos.row=1)) grid.rect(gp=gpar(fill=4),vp=viewport(layout.pos.col=2,layout.pos.row=2)) grid.rect(gp=gpar(fill=5),vp=viewport(layout.pos.col=3,layout.pos.row=1)) grid.rect(gp=gpar(fill=6),vp=viewport(layout.pos.col=3,layout.pos.row=2))  pushviewport(vpvp(pos.col=2.5, pos.row=1.5)) grid.rect(gp=gpar(fill="white")) 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -