#extends doesn't work in Webstorm with Stylus - webstorm

I try to the the #extend function from Stylus in Webstorm, however, I cannot get it to work.
Example:
.icon-right
color #fff
width 35px
height 35px
line-height 40px
font-size 1.4em
text-align center
position absolute
top 35%
left -4%
.icon-right-2
#extends .icon-right
background-color #999
Output:
/usr/local/bin/stylus stylus.styl
/usr/local/lib/node_modules/stylus/bin/stylus:545
throw err;
^
Error: stylus.styl:227
223|
224|
225| .icon-righ-new
226| #extends .icon-right
227|
228|
229|
Failed to #extend ".icon-right"
at /usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:214:24
at Array.forEach (native)
at Normalizer.extend (/usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:212:28)
at Normalizer.visitGroup (/usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:137:8)
at Normalizer.Visitor.visit (/usr/local/lib/node_modules/stylus/lib/visitor/index.js:28:40)
at Normalizer.visitBlock (/usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:112:19)
at Normalizer.Visitor.visit (/usr/local/lib/node_modules/stylus/lib/visitor/index.js:28:40)
at Normalizer.visitGroup (/usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:139:22)
at Normalizer.Visitor.visit (/usr/local/lib/node_modules/stylus/lib/visitor/index.js:28:40)
at Normalizer.visitBlock (/usr/local/lib/node_modules/stylus/lib/visitor/normalizer.js:112:19)
I've tried a different approaches but I recieve the same error. Other Stylus function and Nib are working.

Related

How to change the background color of a row in RDLC report on mouse over?

How to change the background color of a row in RDLC report on mouse over?
set background color on mouse over. To identify rows.
$('table:contains("ID"):last tr') is to get the report table. "ID" is used to find out the report table from the form.
JQuery
function ColorRow() {
$('table:contains("ID"):last tr').addClass('trrr');
}
CSS
.trrr:hover {
background-color: orange;
cursor: pointer;
}
Code in ASPX.CS page Report viewer Load Event (call the JQuery Function)
Note: Must add below code, other wise it will not work in all report pages (just in one page). Also repeat table column header in each page.
protected void ReportViewer1_Load(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, GetType(), "ColorRow", "ColorRow();", true);
}

gtk3 flowbox child 4px padding

I am trying to find a way to get rid of the padding around GtkFlowBox children in PyGtk3.
Here is a minimal example which exhibits the 4px padding around each child.
#!/usr/bin/python2.7
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
window = Gtk.Window()
flowbox = Gtk.FlowBox()
label0 = Gtk.Label("Test0")
label1 = Gtk.Label("Test1")
flowbox.add(label0)
flowbox.add(label1)
window.add(flowbox)
window.show_all()
window.connect('delete-event', lambda window, event: Gtk.main_quit())
print label0.get_allocated_height()
print flowbox.get_child_at_index(0).get_allocated_height()
Gtk.main()
Padding with flowbox;
http://forgottendream.org/~chasm/with_flowbox.png
Desired result without padding. (Default behavior with a GtkBox);
http://forgottendream.org/~chasm/with_box.png
Python version: 2.7.7
Gtk version: 3.12.2
EDIT: The following got rid of the extra space resulting in the same appearance as a GtkBox.
style_provider = Gtk.CssProvider()
style_provider.load_from_data("""
GtkFlowBoxChild {
padding: 0px;
}
GtkFlowBoxChild GtkLabel {
padding: 0px;
}
""");
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
usually a padding of a widget is depends on Gtk.StyleContext () which is your gtk-theme. By default widget has allocated padding arounds it. Play with Gtk.StyleContext to get-set the padding. Or play with "margin"s property of Gtk.Widget. Personally this Gtk.FlowBox are utterly crap unless you want to filter-sort its children, who sorted and filter widgets?

KO Grid Scrollbars not visible & Display issues

I am having two problems with KOgrid.
1) I could not get scroll bars in the kogrid .It is very difficult to do data entry without scroll bars.
2) I also could not get kogrid to working wihout specifying hard coded height and width.In my application I can not have a fixed height and width.
Did anybody else had the same issue ?
I tried a workaround suggestion from this thread ( using jQuery fix as last line in my viewmodel).
KO Grid Display Isseues, On resize Gird shows one row. Images also included
that just increased that size of the grid but it did not display any data . However, when I resize the page data shows up.
Below are my HTML and kogrid options ( I tried with and without paging options, Ideally I do not want to use paging )
<div data-bind="koGrid: gridOptions"
style="height: 800px; background-color: none;width: 1850px;">
</div>
self.gridOptions = {
data: self.mydatarray,
footerVisible: true,
displaySelectionCheckbox: true,
afterSelectionChange: self.RowSelectionChange,
rowHeight: 50,
selectWithCheckboxOnly: true,
enableSorting: false,
multiSelect: true,
selectedItems: self.SelectedRows,
enableColumnResize: true,
showFilter: false,
canSelectRows: true,
enablePaging: true,
pagingOptions: {
currentPage: ko.observable(1),
pageSize: ko.observable(3),
pageSizes: ko.observableArray([3, 6, 9])
},
rowTemplate: errrowtmpl,
columnDefs: [
{ field: 'Customer', displayName: 'Customer', cellTemplate: Customersddedittmpl, headerCellTemplate: headercelltmpl },
...
...
{ field: 'GenNotes', displayName: 'GenNotes', cellTemplate: simpleedittmpl, headerCellTemplate: headercelltmpl }
]
}
Please let me know if you need any more information
Thanks
Kenner Dev
I found a solution to the problems I am facing.
1) I used Jquery to add scroll bar. I added code line below as last line of my data loading function. I am not sure id this breaks any other KOGrid functionality.In my application I did some basic testing and it seems to be working fine.
$("div.kgViewport").css("overflow", "scroll");
2) I still dont know how to solve this problem 100%. It still does not work unless fixed width and height are mentioned in style. In my app I used vw and vh as opposed fixed width and height to solve the problem of making it work on all screen sizes.
<div data-bind="koGrid: gridOptions"
style="height: 73vh;overflow:scroll;width: 96vw;"></div>

Flex Mobile List: How to get rid of grey overlay on renderer tap?

I tried setting all possible styles to something other than grey, just to try and get rid of the grey overlay as shown in the "Hello item 1" in the attached image of a list. Nothing worked. I examined the ListSkin class too and didn't fins anything that would draw these. How to get rid of these overlays?
<s:List id="list" width="100%" height="100%"
dataProvider="{dp}"
focusAlpha="0"
contentBackgroundAlpha="0"
contentBackgroundColor="0xFFFFFF"
selectionColor="0xFFFFFF"
downColor="0xFFFFFF"
borderVisible="false"
>
</s:List>
I just helped a client with this same thing. You, basically, have to extend the LabelItemRemderer class to not draw the rectangle. It is not exposed via styles or colors for you to change.
Look at this code (Starting at line 853 in the LabelItemRemderer):
// Selected and down states have a gradient overlay as well
// as different separators colors/alphas
if (selected || down)
{
var colors:Array = [0x000000, 0x000000 ];
var alphas:Array = [.2, .1];
var ratios:Array = [0, 255];
var matrix:Matrix = new Matrix();
// gradient overlay
matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI / 2, 0, 0 );
graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.endFill();
}
You basically need some way to force this code to not run. You can do this by creating your own itemRenderer from scratch. Or you can extend the LabelItemRenderer, override the drawBackground() method and copy all the parent drawBackground() code into your extended child; minus the block above.
I'd love to see the color exposed as a style or something. I'd love to see a magic property (or style) we could use to make the overlay vanish altogether. Feel free to log this as a bug into the Apache Flex Jira.

How to load ActivityIndicatorView on TableView inside TabBarcontroller, XCode 4.2

Xcode - version 4.2
Target Platform - iPhone
I have a TabBarController , containing 3 tabs. All tabs contain TableViewController wired to the TabBarController via NavigationController. All TableViewController shows data from external URL, and as well have their corresponding DetailViews.
The application works all fine.
I'm unable to add an 'UIActivityIndicatorView" while the data on the TableView is being loaded. The 'storyboard' neither allows me to add the 'UIActivityIndicatorView' control on the TableViewController or UINavigationController.
Note :
I understand placing UIActivityIndicatorView directly on a UIViewController.
I dont want the UIActivityIndicatorView 'loading' for the cells in the TableView.
Thanks,
Sriram
I'm trying to do the same with Storyboard but it seems that you should bette do it programmatically :
In your ViewController.h :
#property (strong) UIActivityIndicatorView *activityIndicator;
In viewDidLoad :
// init with desired state
activityIndicator = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
// set the color
activityIndicator.color = [UIColor blackColor];
activityIndicator.frame = CGRectMake(0.0, 0.0, 40.0, 40.0);
// set the position
activityIndicator.center = CGPointMake(self.view.bounds.size.width/2,
self.view.bounds.size.height/4);
If you have to handle orientation change, think to update the position in viewWillAppear and willRotateToInterfaceOrientation
I think I'll loose less time to code that than time to find a better way to work with Storyboards