Why use Math.min in layout method [closed] - blackberry

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Why use Math.min in below overridden method ?
protected void layout(int width, int height)
{
setExtent(Math.min( width, getPreferredWidth()), Math.min( height, getPreferredHeight()));
}
I seen this code in this question -
BlackBerry - ButtonField with centered Bitmap

I found this helpful -
http://supportforums.blackberry.com/t5/Java-Development/Question-Regarding-setExtent-and-getPreferredWidth-for-Custom/td-p/469886
"Note that the values used for setExtent should never be larger than the values passed in to layout. These are the maximum extent available to the field."

Related

ios charts - Display labels on inside of axis [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
This is what my graph currently looks like.
I am trying to put the axis labels on the right side of the left axis in ios charts by danielgindi as seen in the second picture above. Any suggestions, I have checked countless forums and posts send help.
As per your requirement you can use below property to get your YAxis labels inside chart.
Swift :
lineChartView.leftAxis.labelPosition = .insideChart
lineChartView.rightAxis.labelPosition = .insideChart
Objective-C:
self.lineChart.leftAxis.labelPosition = YAxisLabelPositionInsideChart;
self.lineChart.rightAxis.labelPosition = YAxisLabelPositionInsideChart;
Hope this will helps!
Output :

How to recognize the lightning on the picture? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My task is recognition a lightning on the picture. I have chosen to use OpenCV.
I'm using binary tresholding to get image like this.
Original:
After binary thresholding:
How now to determine whether there is lightning in the image?
So, how to distinguish lightning on the image from other lines? For example
on this image after binary tresholding i have got the following:
but if i just count the number of white pixels - i get a wrong answer.
Main part of my code:
if ((Igray = cvLoadImage(argv[1], CV_LOAD_IMAGE_GRAYSCALE)) == 0) {
return -1;
}
int block_size = atoi(argv[2]);
double offset = (double)atof(argv[3]);
Iat = cvCreateImage(cvSize(Igray -> width, Igray -> height), IPL_DEPTH_8U, 1);
// treshold
cvThreshold(Igray, Iat, offset, 255, CV_THRESH_BINARY);

XCode line breaks - don't truncate label [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have a label in Xcode, and when the text is long, I don't want it to truncate, but I want the remaining text to go into a new line. I made room for 3 lines, but again, it's only truncating. How can I solve this?
Thanks.
yourLabel.lineBreakMode=UILineBreakModeWordWrap;
yourLabel.numberOfLines=0;
note: it is deprecated in ios6, then use:
NSLineBreakByWordWrapping
I achieved the effect by also specifying the number of lines I wanted to appear
[self.label setLineBreakMode:NSLineBreakByWordWrapping];
[self.label setNumberOfLines:3];
[self.label sizeToFit];

How can I change the color of certain characters in a TRichEdit? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm doing a Delphi 7 project where I have to let a user enter in a number (Layers going down) to build a Christmas tree, but I also need to display the output as * (stars). I am having a problem editing a certain line of stars in the TRichEdit to make the color change randomly just like a real Christmas tree shines.
Formatting in rich edit controls works by first selecting text, then applying formatting to that selection.
Select the text with the SelStart and SelLength properties.
Apply formatting with the SelAttributes property, for example SelAttributes.Color := clRed;.

Disappearing components? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have a canvas which contains a single myComponentA. A myComponentA contains a MyComponentB. The myComponentB contains a number of myComponentA's giving a tree structure...Ok so far.
The structure is stored as an XML file.
When I load a big (60 or so components), the components are not visible... When I change the player quality to low or medium they appear...!?
Towards the bottom of the diagram a component is clipped through the middle as though it has been cut off...(The containing canvas continues on empty...)
This is probably an issue with the flex measuring mechanism. Your myComponentA should probably report its measuredHeight and measuredWidth to the parent container. This will likely be done, in your case, in an override of the measure function. e.g,
override protected function measure():void {
measuredWidth = //x position + width of rightmost child
measuredHeight = //y position + height of bottommost child
super.measure();
}
If you do something like this in both myComponentA and myComponentB, and you inherit from a Container (e.g., canvas) then things should work mostly. If your components inherit from UIComponent, you might have more trouble (i.e., there won't be any scrollbars).
Keep in mind that the measure function only sets the measuredHeight and measuredWidth. Depending on your situation, you may need to overide updateDisplayList as well to properly set the actual height/width/positions of the children.

Resources