grid

Snap to grid effect with Quartz 2d? iphone dev

走远了吗. 提交于 2019-12-06 13:55:38
问题 Still an iphone dev starter but trying. I would like to have the user touch the screen at which point a pin (dot) will be placed on the view. I have accomplished this (yey) but i would like to have snap to grip effect, and can not come up with a solution. This is how i am placing that dot: CGPoint drawPoint = CGPointMake(lastTouch.x - horizontalOffset, lastTouch.y - >verticalOffset); [drawImage drawAtPoint:drawPoint]; //Tell the image to draw itself I have a grid as a background on a

Split screen based on number of items and screen ratio

时光毁灭记忆、已成空白 提交于 2019-12-06 13:51:58
问题 I have to split the screen equally (as possible) given a dynamic number of items. So i need to find the number of columns and rows based on the screen size/ratio. Each item size is not important since i will calculate them in % based in the items per col and row. If i have 5 items, then (depending on the screen ratio) i will probably have 3 columns in the 1st row and 2 columns in the 2nd row. That's ok. 回答1: First you have to decide what you mean with "divide the screen equally". It probably

.NET WinForms - Programmatically End Current Edit - DataGridView

邮差的信 提交于 2019-12-06 12:42:51
How can you programmatically end the current cell edit without losing the change? I have my DataGridView set to EditOnEnter mode. I tried EndEdit() on the grid but this backs out the current edit. Assuming this is remarkably close to what I've done with the grid and without seeing any code, the only thing I did differently was to follow the call to EndEdit on the DataGridView with a call to EndEdit on the BindingSource. 来源: https://stackoverflow.com/questions/1394364/net-winforms-programmatically-end-current-edit-datagridview

Zurb Foundation 5: Grid Column Stacking

家住魔仙堡 提交于 2019-12-06 11:49:08
问题 I'm new to foundation and I only have the basic idea on how to use grids. I have these 3 columns that need to be stacked (see "mobile" image) when viewed on mobile/small screens. It should look something like this when in larger screens: Here's my current code. It's not quite what I wanted, and I'm starting to get confused. <div class="row"> <div class="large-12" style="background-color:#bdc3c7;"> <div class="medium-4 medium-push-8 columns" style="background-color: #1abc9c; border: 1px solid

javafx make a grid of buttons

只愿长相守 提交于 2019-12-06 11:46:47
I want to make a grid with a specific amount of buttons. I know how many buttons there are need to be because I get the number of rows and columns. I could do a loop, but I don't know how you can place buttons next to eachother and underneath. Secondly, the buttons need a Text and an Id, text is no problem, but how do you give them an id? And at last, and probably most difficult, it can occur that there are a lot of rows, so that a scrollbar should be available. At the end it should look something like this: @Override public void start(Stage stage) { GridPane grid = new GridPane(); grid

ASP.net Grid paging with merged rows

一笑奈何 提交于 2019-12-06 11:27:59
I am currently using GridView to display tabular data. I need to merge cells in the first column that have equal values. At the moment I have code in the PreRender event to set the RowSpan property for me, and it's working fine. The problem is I cannot use paging, since the pages will split in the middle of a section where the first field is equal. I want the record count for paging to count one for each of the merged rows, rather than one for each sub-row. Is this possible with GridView or some other jQuery grid? Instead of handling the merging at the UI level, would it work to prepare the

Create a grid of buttons using a loop in PyQT4

风格不统一 提交于 2019-12-06 11:27:42
问题 Is there a way to create a grid of buttons using a loop in PyQT4? So for example, something that has the effect of: for j in range(0, 10): for k in range(0, 10): grid.addbutton(j, k) Thank you. 回答1: Sure there is. QGridLayout might be useful in this case. Here is a minimal example: import sys from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) widget = QtGui.QWidget() layout = QtGui.QGridLayout() buttons = {} for i in range(10): for j in range(10): # keep a reference to the buttons

Magento select field disables row in related products

混江龙づ霸主 提交于 2019-12-06 11:22:25
I have added a tab with functionality similar to related products, I have added a column with a dropdown like this: $this->addColumn('mycolumn', array( 'name' => 'mycolumn', 'header' => Mage::helper('catalog')->__('Display on current child page'), 'index' => 'mycolumn', 'type' => 'select', 'width' => '1', 'align' => 'center', 'options' => array( 1 => Mage::helper('catalog')->__('Yes'), 0 => Mage::helper('catalog')->__('No'), ), 'editable' => true )); Everytime i change the selection my product gets unchecked and the row is disabled. I found that this line was commented in magento:

Using a Grid as an ItemsHost

佐手、 提交于 2019-12-06 10:31:20
问题 I would like to use a Grid as an ItemsHost but none of the items appear in their bound (column, row) positions. How can I make this work? As a simple example: XAML <ItemsControl ItemsSource="{Binding DataSet}"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock Grid.Column="{Binding Col}" Grid.Row="{Binding Row}" Text="{Binding Text}" /> </DataTemplate> </ItemsControl.ItemTemplate> <ItemsControl.Style> <Style TargetType="{x:Type ItemsControl}"> <Setter Property="Template"> <Setter.Value>

Multiline grid with elements of same height using flexbox

隐身守侯 提交于 2019-12-06 09:33:25
问题 I'm trying to create a grid which will have multiple row and columns. I'd like them all to have the same height using flexbox, but the only thing I can get is columns of same size on one row. Here is an example of what I'm trying to do: http://jsbin.com/maxavahesa/1/edit?html,css,output In this example I'd like all my <li> 's to have the same height, which means the height of the biggest item (in my example, this would be the last <li> ). Is it possible to achieve with flexbox ? 回答1: No, this