BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-02-2009, 08:11 AM   #1 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Unhappy Screen Development With Dialog Extended Class

Please Login to Remove!

I have developed a Screen as shown in the Image. I want the screan layout and extent to fit around the periferi of the red rectangle. If I try to do so using overriden sublayout and getPreferredHeight(), and getPreferredWidth(),
The area inside outer red rectangle wipes out though the screen of this shape is created. Please assist me how to create a screen to have my Dialog Box customised like this.
I cannot find the solution to this in KB
Regards
Attached Images
File Type: png 8300-01.png (9.7 KB, 55 views)
__________________
having new s for developers!!!
Offline  
Old 02-02-2009, 08:14 AM   #2 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default Ok I Have these Already in My knowledge Bank, I want more..

Code:
Important Notes On BlackBerry
------------------------------
The Steps in creation of a Ui

	1. Access UiApplication from any where to use invokeLater and other things.
	2. Access MainScreen from any where using getScreen() function of a field and UiApplication.
	3. Access fields from anywhere using getFieldCount() and getField(int pos)of getScreen() ofand UiApplication, you can use instanceof.UiApplication also gives access on all the previous and next screens.
	4. Use invokeLater() of UiApplication to update screen or show alerts in threads.
	5. Use Threads to perform the IO Operations. And tiresome processes also.
	6. To make custom fields override there onFocus, onUnFocus, layout, paint, paintBackground, drawFocus, isFocusable. To Redraw call the invalidate Function from the outside of the functions using Graphics.
	7. For fields like ListField and EditField there are special drawing functions to draw screen as drawListRow, drawText respectively.Don't Override the functions onFocus, onUnFocus, layout, isFocusable for the Multiple Fielded List. You don't even need to override the drawFocus, or paint, or paintBackground as the drawListRow and DrawText are enough. device some conditions to show the focus therein. Issue with the draw Text is that you have to allign the caret position with the Text drawn, hence you have to modify the label of the Field to do so. So you can use the Paint to only draw the other graphics you want, while allow the default drawText to do its drawing.
	You need the drawText only if you want to change the color of the text.
	Use FocusListener to determine when the internal focus was changed and baased on boolean and the background change the color in the drawListRow. you can get the active focus rect using Graphics g.getClipRect(); that returns XYRect.
	8. Context Menu are specific to Fields and MenuItem are specific to Screens.
	9. Search: return original when search string null, return null when search result null, return the results.
Vectors can be very helpful.
	10. Access and Set the System Font from any where, specify size between 10 and 20 from Font, FontFamily class.
	11. The height of every field in a vertical arrangement is Display.getHeight()/6. so that 6 fields can be placed one on the top of other to fill up the screen.
	12. On Screen subLayout fixes left, top origin of display; setExtent fixes width, height.
	13. For fields : to position the fields on the Screen call childLayout, which will set the height and width of the field and call the setPosition child to set the x,y of the left top of the field.
	14. If you call getContentRect of the field you get the rect where the content is occupied, while the getExtent gives you the whole rect occupied by the field.
	15. Make two Managers : 1 for painting and another for laying out the buttons on the screen. add painted manager in the manager with fields and then add fields in the. The default mainscreen which has these managers should be laid out properly.
	
	
OTA deployment of the COD files.
--------------------------------
	1. The Application (Ui) has to be made in a way that it consists of Main UiApplication and other classes in the form of library. This should insure that each part is less than 60KB. compile packages in the Application into a different lirary (without the Application).
	2. The OTA now will not modify the library jars and treat them as the essential part of the main Application.
	OTHER WAY:
	1. After the signing, Extract the cod file using a ZIP utility if it is too big.
	2. modify the names with a common suffix and the same in the JAD file with the size before deploying.
	as Under:
		RIM-COD-URL: MyApp.cod
		RIM-COD-Size: 213916
		with:
		RIM-COD-URL-1: MyAppOTA.cod
		RIM-COD-Size-1: 96680
		RIM-COD-URL-2: MyAppOTA-1.cod
		RIM-COD-Size-2: 59780
		RIM-COD-URL-3: MyAppOTA-2.cod
		RIM-COD-Size-3: 56380
		
Key Strategies
--------------
1) make singleton classes.
2) use public inner classes (instead of making new instances) in just one class. You can pass the address of the classes declared as public in main class to the requiring functions or classses. Save resources.
3) Use synchronize (blocks or access type)only if you see there are objects shared by multiple threads and a semaphore is needed.
4) In threads the global variables can't be used, try use final variables.
5) don't use too much of / unnecessary static variables.
__________________
having new s for developers!!!

Last edited by abhsax1978@hotmail.com : 02-02-2009 at 08:19 AM.
Offline  
Old 02-03-2009, 05:37 AM   #3 (permalink)
Thumbs Must Hurt
 
abhsax1978@hotmail.com's Avatar
 
Join Date: Jun 2008
Location: NOIDA
Model: 8100
OS: 4.2.1.91
PIN: 2052AEF9
Carrier: Soft. Engg.
Posts: 111
Post Thanks: 4
Thanked 0 Times in 0 Posts
Default

Ok, Got the solution : just use the paintBackground and add your controls.
you can use getClippingRect of Graphics to draw any thing in the visible reagion.
No need to add separate Vertical or HorizontalFieldManager to layout the fields as this is inbuilt.
if you end the Paint.. function with the setColor(someColor); then the labels of your added editField are shown with that color.
Regards
__________________
having new s for developers!!!
Offline  
Old 06-15-2009, 04:23 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Location: India
Model: 9000
Carrier: AirTel
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

good post
__________________
Praveen K
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.