Re: non-standard font alignment

2007-11-05 Thread Michal Seliga
you can patch pilrc from sources and set correct char widths with it. thats only
way i am aware of. problem is that pilrc doesn't store RIGHT, CENTER etc. in
resources (palm doesn't know such things) but it calculates dimensions and
coordinates from text and used font. idf later font is changed its too late.

the best way how to solve such things is set and move all controls in runtime
depending on font actually used. this will work also in case somebody uses some
hack to change default fonts with others.

JSeb wrote:
 Hi Palm developpers and gurus.
 
 I’m pretty sure this has already been answered somewhere, but I couldn’t find 
 it.
 
 I’m using PilRC to construct my forms. I noticed that when I don’t use the 
 standard font set on my palm (e.g., through fontsmoother), the font alignment 
 on my forms is broken (specifically, when I use CENTER or RIGHT horizontal 
 tags in my resources, or when I have relative horizontal alignment à la 
 PREVxxx).
 
 So the font I use is wider or narrower than the standard version (the problem 
 doesn’t manifest itself with FONT 0, though).
 
 Is it me that uses a badly-designed font? It doesn’t seem to be a problem 
 with other applications, but then again I seem to notice that static forms in 
 other applications (e.g. “about” screens) make a sparse use of centering.
 
 How is this issue usually solved?
 

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: non-standard font alignment

2007-11-05 Thread JSeb
Thank you for your answer, Michal.

So what you say is, build the forms programmaticaly?

That's what I was afraid of. I guess that's one reason why most static forms I 
can find seem to be left-aligned.


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: non-standard font alignment

2007-11-05 Thread Lionscribe
Just call this function to center the object.
You will have to call FrmDrawForm
when done.
void CenterObject(FormType * formP, UInt16 objectID)
{
RectangleType rect, rectForm;
UInt16 objIndex = FrmGetObjectIndex(formP, objectID);
FrmGetObjectBounds(formP, objIndex, rect);
FrmGetFormBounds(formP, rectForm);
rect.topLeft.x = (rectForm.extent.x -  rect.extent.x) / 2;
FrmSetObjectBounds(formP, objIndex, rect);
}

 

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: non-standard font alignment

2007-11-05 Thread Lionscribe

Just call the following function to center the object.
You will have to call FrmDrawForm
when done.

void CenterObject(FormType * formP, UInt16 objectID)
{
RectangleType rect, rectForm;
UInt16 objIndex = FrmGetObjectIndex(formP, objectID);
FrmGetObjectBounds(formP, objIndex, rect);
FrmGetFormBounds(formP, rectForm);
rect.topLeft.x = (rectForm.extent.x -  rect.extent.x) / 2;
FrmSetObjectBounds(formP, objIndex, rect);
}
Lionscribe

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/