custom-controls

Custom DataGridViewColumn value disappears after loosing focus

邮差的信 提交于 2020-01-02 08:35:32
问题 I have created a custom DataGridViewColumn for my project in WinForms. The control renders perfectly, but once I input the value and move to another cell, the value disappears and comes up as null when I check in CellEndEdit. Following is the code: class NumericEditControl : NumericTextBox, IDataGridViewEditingControl { DataGridView dataGridView; private bool valueChanged = false; int rowIndex; public NumericEditControl() { this.Value = 0; } public void ApplyCellStyleToEditingControl

Custom DataGridViewColumn value disappears after loosing focus

我的未来我决定 提交于 2020-01-02 08:35:12
问题 I have created a custom DataGridViewColumn for my project in WinForms. The control renders perfectly, but once I input the value and move to another cell, the value disappears and comes up as null when I check in CellEndEdit. Following is the code: class NumericEditControl : NumericTextBox, IDataGridViewEditingControl { DataGridView dataGridView; private bool valueChanged = false; int rowIndex; public NumericEditControl() { this.Value = 0; } public void ApplyCellStyleToEditingControl

Qt customizing save file dialog

╄→гoц情女王★ 提交于 2020-01-02 04:47:06
问题 I need to customize default Qt save file dialog: add some options in it. For example, adding some checkboxes with my own values in it between file type and save/close buttons. Have Qt any ways to do it? 回答1: You can customize the Qt file dialog as long as you're okay with using the "non-native" Qt file dialog that comes with Qt; the other option Qt provides is to use the OS's native file dialog, but if you do that there is no way (that I'm aware of) to customize the dialog. Here's an example

ASP.NET custom control: when is LoadPostData() called?

与世无争的帅哥 提交于 2020-01-02 03:12:23
问题 I have developed a custom control that extends ListBox. The idea is that the control 'remembers' modifications to its elements which occurred client-side, e.g. as a result of an AJAX request. The way it works is that the control also renders a hidden input, and the result of the AJAX request is stored in the hidden input. This is posted back, and the control's LoadPostData() method looks for the hidden input, and if the hidden input has data, creates the ListItem collection from it. This

Android Custom Control namespace issue

匆匆过客 提交于 2020-01-02 03:00:49
问题 I've been working on a Custom Control for Android and although I tried to do what's suggested here there seems to be something I'm doing wrong. Here's my code to see if anyone can spot the problem: MyComponent.java public MyComponent(Context context, AttributeSet attrs) { super(context); TypedArray arr = context.obtainStyledAttributes(attrs, R.styleable.MyComponent); CharSequence myId = arr.getString(R.styleable.MyComponent_identifier); if (myId != null) { this.setIdentifier(myId.toString());

viewForHeaderInSection creating a memory leak?

旧时模样 提交于 2020-01-01 22:47:14
问题 I am having great success getting the look I want using a custom header view and the delegate method tableView: viewForHeaderInSection:. But I think it is producing a memory leak, and I'm not sure what to do about it. The code is this: - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { NSLog (@"New header, section %d", section); ResultsHeaderView *header = [[ResultsHeaderView alloc] initWithFrame:CGRectMake(0, 0, defaultResultsHeaderSize.width,

Performing OpenGL Drawing from within a Thread

狂风中的少年 提交于 2020-01-01 12:31:51
问题 I've been wrapping the core OpenGL functionality within a Delphi VCL custom control. Currently, I am doing a loop using a TTimer created within this control. I strongly feel using a timer is completely wrong, as drawing could both overlap and have delays. Instead, I would like to put this drawing loop within a thread. Please refer to my original question with some issues of flickering - which I'm putting the blame on the TTimer which I'm using. Question Is OpenGL safe to use inside of a

Performing OpenGL Drawing from within a Thread

时间秒杀一切 提交于 2020-01-01 12:31:09
问题 I've been wrapping the core OpenGL functionality within a Delphi VCL custom control. Currently, I am doing a loop using a TTimer created within this control. I strongly feel using a timer is completely wrong, as drawing could both overlap and have delays. Instead, I would like to put this drawing loop within a thread. Please refer to my original question with some issues of flickering - which I'm putting the blame on the TTimer which I'm using. Question Is OpenGL safe to use inside of a

Why shouldn't you use a handle during component creation or streaming?

别等时光非礼了梦想. 提交于 2020-01-01 12:08:30
问题 I want to make a custom VCL control that wraps a SDL rendering surface via the SDL_CreateWindowFrom function. SDL_CreateWindowFrom takes an existing HWND handle and puts a high-performance rendering context (it has several backends available, including DirectX and OpenGL) onto it. The helpfile says "Do not refer to the Handle property during component creation or streaming." But it doesn't say why. It says that the first time you try to access the Handle property, it'll call HandleNeeded to

Android: Custom button OnClickListener is not getting invoked

半腔热情 提交于 2020-01-01 10:56:48
问题 I have a custom button, on which I am capturing its onTouchEvent. public class CustomNumber extends ToggleButton { boolean drawGlow = false; float glowX = 0; float glowY = 0; float radius = 30; public CustomNumber(Context context) { super(context); } public CustomNumber(Context context, AttributeSet attrs) { super(context, attrs); } public CustomNumber(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } Paint paint = new Paint(); { paint.setAntiAlias(true);