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.

actionscript 3 - Can't resize content to fit a new NativeWindow in AIR -


i'm trying make popup window class content disaplyobject, , popup , display in itself, i'm cracking head matching size of content window or vise versa... think maybe window not display of stage or ?!

the content way big..and goes out of bounds.

here code :

public class subwindow extends nativewindow{   public function subwindow()    {     var windowoptions:nativewindowinitoptions = new nativewindowinitoptions();      windowoptions.systemchrome = nativewindowsystemchrome.standard;      windowoptions.type = nativewindowtype.utility;    windowoptions.resizable = false;    super(windowoptions);    this.stage.align = stagealign.top_left;      width = 400;      height = 400;      title = "are sure?";    alwaysinfront = true;    activate();    visible = false;    addeventlistener(event.closing, closewindow, false, 0, true);    }    public function closewindow(e:event)   {    e.stopimmediatepropagation();          e.stoppropagation();          e.preventdefault();    visible = false;   }    public function setcontent(cont:displayobject)   {    visible = true;    //this.width = stage.stagewidth;    //this.height = stage.stageheight;    trace(cont.getbounds(stage), width, height, stage.stagewidth,stage.stageheight);      cont.height = stage.stageheight;    cont.width = stage.stagewidth;    cont.x = cont.y = 0;    this.stage.addchild(cont);    trace(cont.width, width, height, stage.stagewidth,stage.stageheight);   }  } 

thanks, mik

now i've solved think!

first create content:

var mycontent:mycustomcontentclass = new mycustomcontentclass(); 

then create window , set size , position

var mywindow:nativewindow = new nativewindow(); mywindow.stage.align = stagealign.top_left; mywindow.width = mycontent.width; mywindow.height = mycontent.height 

and set scale mode no scale:

mywindow.stage.scalemode = stagescalemode.no_scale; 

and add content

mywindow.stage.addchild(mycontent);  mywindow.activate(); 

i still have minor ssues when running on osx, think has size of system chrome.


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 -