grid

Plotting a line on a grid layout, then addition veritcal axis

懵懂的女人 提交于 2019-12-08 11:17:16
问题 SOLUTION AT BOTTOM OF THIS QUESTION I have this code: public void lineImproved(int x0, int y0, int x1, int y1, Color color) { int pix = color.getRGB(); int dx = x1 - x0; int dy = y1 - y0; raster.setPixel(pix, x0, y0); if (Math.abs(dx) > Math.abs(dy)) { // slope < 1 float m = (float) dy / (float) dx; // compute slope float b = y0 - m*x0; dx = (dx < 0) ? -1 : 1; while (x0 != x1) { x0 += dx; raster.setPixel(pix, x0, Math.round(m*x0 + b)); } } else if (dy != 0) { // slope >= 1 float m = (float)

How to reuse Menu and Toolbar in different WPF UserControls with adding new buttons?

天涯浪子 提交于 2019-12-08 10:40:02
问题 I'm trying to port current WinForms app to WPF and need help with building WPF class structure. Currently in WinForms, I have one base class (with Menu, Toolbar, Grid and Context menu) and several inherited classes with different datasources and columns for the grid and additional buttons for menu, toolbar and context menu. Questions: What will be the best WPF class structure for my usercontrol to avoid inheritance? Can I move ToolBar into ResourceDictionary (e.g. ControlTemplate )? How to

Full with background with fixed with content

廉价感情. 提交于 2019-12-08 10:26:37
问题 I've got the following two containers that should be 1400px width in total. The problem in my code is that the background isn't 100% width when I want the two containers to be 1400px. How can I achieve this the best way? I hope you guys get my problem. I am using the following code: .wrapper { max-width: 1400px; margin: 0 auto; padding: 0 50px; } #left-container { width: 50%; background: blue; float: left; } #right-container { width: 50%; background: green; float: left; } <div class="wrapper"

Accessing Object of Magento Admin Grid via Java-Script

若如初见. 提交于 2019-12-08 09:56:19
问题 I would like to access the JavaScript Object of the Magento Adminhtml Grid. I want to reload the Grid after my Dialog is closed an the Ajax-Request to the Controller has finished. If i modify the grid.js this is easy to make. But i don't want to modify the grid.js of magento itself. Any ideas how i can access that object? 回答1: Late answer, but maybe it will help someone If you setup the grid in Grid.php like this: parent::__construct(); $this->setId('your_grid_id'); . . . from javascript,

Hiding grid columns change height of rows

烈酒焚心 提交于 2019-12-08 09:37:14
问题 I have quite annoying problem with hiding grid columns dynamically. After I hide columns (with long text in cells), the height of grid rows dramatically increases. Before hide and after hide operation As You can see first row is definitely too high. Probably the reason of that behavior is the fact, that I use text wrap in grid cells. .x-grid-cell-inner { white-space: normal; } Is there any efficient way to make grid rows, not to change their height after hiding columns (and using textwrap ) ?

How to show data in Extjs grid.panel

妖精的绣舞 提交于 2019-12-08 09:21:37
问题 Is this the correct way to initialize my view? I have this code: Ext.define('AS.view.View', { extend: 'Ext.grid.Panel', alias: 'widget.view', store: 'Store', initComponent: function () {} }); The store is configured on the grid, shouldn't I see data?. Can someone help me? 回答1: You should put this.callParent(arguments); in the initComponent method You can either autoload the store or call load() on the store when your view renders. Either: //store config autoLoad: true or //view config

Ext.grid.Panel in Ext 4 not loading data from Ext.Direct proxy store

不打扰是莪最后的温柔 提交于 2019-12-08 08:45:26
问题 I've eliminated all exceptions from this code. However, the data from my proxy isn't rendering in my Ext.grid.Panel widget. Below you will find the different components of the page as it renders. I did not include the server-side stack code for the Ext.Direct proxy. HTML: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Ext Direct Grid Integration</title> <link rel="stylesheet" type="text/css" href="http://www.rasc.ch/extjs-4.1.3/resources/css/ext-all.css" /> <link rel="stylesheet"

Dynamacly Changing type in Grid

♀尐吖头ヾ 提交于 2019-12-08 08:21:17
问题 I have some store, which is formed data. On panel, it looks how "fieldName" and text field (in depension from invoked form). For example, on one form is displayed "name document" and field, on another: date of selling and date field. Data is formed dynamically. Here is store: someStore = new Ext.data.JsonStore({ storeId: 'myStore', url: objectUrlAddress, baseParams: { 'objectID': objectID }, root: 'Fields', fields: [{ name: 'Hint' }, { name: 'Type', type: 'int' }, { name: 'Value' }, { name:

How to focus on editable textfield when checkbox is checked in ExtJS Grid?

我的梦境 提交于 2019-12-08 07:27:34
问题 I am creating a grid with checkcolumn and celledit. I have 3 columns 1 is for checkboxes and other is editable text field and 3rd is the productname, using celledit to edit the price. When I will check a checkbox on a record the focus should be on the textfield for that particular record. Here is the code sample: Ext.define('MyApp.view.EntryPage', { extend : 'Ext.grid.Panel', alias : 'widget.entryPage', title : 'Product Price Entry', store : 'ProductStore', loadMask: true, plugins: [Ext

SWT Section reserves too much vertical space when using a custom row layout for its children

℡╲_俬逩灬. 提交于 2019-12-08 06:24:30
问题 I use a GridLayout with one column inside a Section . There are three "rows" in the grid, having a white background. I would like the Section to grab horizontal space but only as much vertical space as needed : Each row uses a custom row layout and has two children. Furthermore, that row layout has two states: a) show on a single line (if total width is large enough) b) show second child (red) on an extra line (if total width of window is too small for both children) For both states I would