Click here to Skip to main content
15,892,809 members
Articles / Desktop Programming / Windows Forms

An Alpha Channel Composited Windows Form with Designer Support

Rate me:
Please Sign up or sign in to vote.
4.96/5 (124 votes)
5 Oct 2009CPOL8 min read 324.1K   48.8K   279  
An alpha channel composited form for image based Window frames
	// a member filter

	function MemberFilter () {

		// set up defaults

		this.subgroup = "all";

		this.public = true;
		this.protected = true;
		this.private = true;

		this.instance = true;
		this.static = true;

		this.declared = true;
		this.inherited = true;

	}

	MemberFilter.prototype.filterElement = function(element) {

		// get the data for the element
		if (element == null) return;
		var data = element.getAttribute("data");
		if (data == null) return;
		var datum = data.split("; ");
		if (datum.length != 4) return;
        
		// extract the relevent member attributes
		var subgroup = datum[0];
		var visibility = datum[1];
		var binding = datum[2];
		var origin = datum[3];

		// determine whether to show the member
		var show = true;
		if (this[visibility] == false) show = false;
		if (this[binding] == false) show = false;
		if (this[origin] == false) show = false;
		if ((this.subgroup != null) && (this.subgroup != 'all')) {
			if (subgroup != this.subgroup) show = false;
		}

		// show or hide the element
		if (show) {
			// either block or table-row, depending on browswer, so use default
			element.style["display"] = "";
		} else {
			element.style["display"] = "none";
		}

	}

	// a type filter

	function TypeFilter () {

		// set up defaults

		this.subgroup = "all";

		this.public = true;
		this.internal = true;

	}

	TypeFilter.prototype.filterElement = function(element) {

		// get the data for the element
		if (element == null) return;
		var data = element.getAttribute("data");
		if (data == null) return;
		var datum = data.split("; ");
		if (datum.length != 2) return;
        
		// extract the relevent member attributes
		var subgroup = datum[0];
		var visibility = datum[1];

		// determine whether to show the member
		var show = true;
		if (this[visibility] == false) show = false;
		if ((this.subgroup != null) && (this.subgroup != 'all')) {
			if (subgroup != this.subgroup) show = false;
		}

		// show or hide the element
		if (show) {
			// either block or table-row, depending on browser, so use default
			element.style["display"] = "";
		} else {
			element.style["display"] = "none";
		}

	}

	

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
Jeff Anderson has been a computer graphics software developer for over twenty years.

He is a co-founder of Braid Art Labs and a developer of Braid's GroBoto 3D software. Jeff also dabbles in shareware with an expanded version of the AlphaForm control and other programs here.

Comments and Discussions