Skip to content

Instantly share code, notes, and snippets.

View johnspackman's full-sized avatar

John Spackman johnspackman

View GitHub Profile
/**
* Header cell widget for filtering
*
* @childControl label {qx.ui.basic.Label} label of the header cell
* @childControl icon {qx.ui.basic.Image} icon of the header cell
*
* @asset(grasshopper/decoration/table/16/*)
* @asset(grasshopper/icon/16/tick.png)
* @asset(grasshopper/icon/16/cross.png)
*/
/**
* Image which preserves the aspect ratio while scaling the image and constrains
* the dimensions to stay within the min/max width/height. The image is placed
* centrally within the dimensions of the widget.
*
* Based on the Qooxdoo image
*/
qx.Class.define("grasshopper.af.ui.image.Image", {
extend : qx.ui.core.Widget,
@johnspackman
johnspackman / Appearance Excerpt
Created June 17, 2019 13:53
Example input field with button
"searchfield": {
include: "textfield",
style: function(states, style) {
style = qx.lang.Object.clone(style);
style.padding = 0;
style.margin = 0;
return style;
}
},
/**
* Provides a registry of top level objects
*/
qx.Class.define("qx.core.Id", {
extend: qx.core.Object,
include: [ qx.core.MObjectId ],
type: "singleton",
members: {
var t = this;
var FUNCTION_TESTS = [
{
title: "qx.Bootstrap.isFunction",
fn: function() {
return qx.Bootstrap.isFunction(qx.Bootstrap.isFunction);
}
},
{
@johnspackman
johnspackman / gist:7133517
Last active December 26, 2015 09:59
Demo of issue raised at https://github.com/chjj/blessed
var blessed = require('blessed');
function createScreen() {
var global = blessed.Screen.global;
var screen = blessed.Screen.global || blessed.screen({ tput: true });
if (!global) {
screen.program.key('C-c', function() {
return process.exit(0);
});
var blessed = require('blessed');
function createScreen() {
var global = blessed.Screen.global;
var screen = blessed.Screen.global || blessed.screen({ tput: true });
if (!global) {
screen.program.key('C-c', function() {
return process.exit(0);
});
var blessed = require('blessed');
// Create a screen object.
var screen = blessed.screen();
var form = blessed.form({
width: 40,
height: 8,
border: {
type: "line"
@johnspackman
johnspackman / gist:6193853
Created August 9, 2013 14:06
shows a problem with node.js blessed keybaord handling (fixed in pull request)
var blessed = require('blessed');
// Create a screen object.
var screen = blessed.screen();
var list1 = blessed.list({
width: 50,
height: 10,
top: 1,
left: 1,
var blessed = require('blessed');
// Create a screen object.
var screen = blessed.screen();
var list = blessed.list({
width: 50,
height: 10,
top: 1,
left: 1,