It is currently Sun May 28, 2017 7:09 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 13  Next
Author Message
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Thu Jan 19, 2012 7:46 pm 
Offline
Site Admin
User avatar

Joined: Fri May 06, 2011 1:33 am
Posts: 2013
Wow!


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Fri Jan 20, 2012 4:01 pm 
Offline
User avatar

Joined: Thu Dec 15, 2011 1:11 am
Posts: 27
bcFORMCOMBOBOX and clipping sounds great, can't wait to try them and other changes.

_________________
Wallabri via downunder
Samsung Galaxy SII


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Tue Jan 24, 2012 9:10 pm 
Offline

Joined: Wed Sep 28, 2011 9:35 am
Posts: 112
Hey Jeff,

First, thanks again for such a great extension of BASIC!

I've been doing some experimenting and have found that the message boxes don't appear to be centering on my screen properly. Furthermore, there doesn't appear to be a way to adjust their dimensions or colors. Maybe I'm overlooking something?

This is on a Motorola Electrify, running Gingerbread 2.3.5, qHD screen (540x960).

Note, I'm using portrait orientation.

One small feature request, too: would it be possible to add a "flat" parameter to buttons so that they can be drawn without the raised edges? Thanks for considering!


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Wed Jan 25, 2012 1:52 am 
Offline

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
Not sure what could be causing the MsgBox$ positioning problem. I've noticed people mentioning a problem getting the correct screen sizes that matched with the screen orientation. Could this be the problem? Try hard coding the screen sizes - see TestBed code for example - there's a couple of commented out lines to do this I used for testing.
Do you want to set the size and colours of each individual MsgBox$ or just the size/colours of all Currently the MsgBox$ size is based on the Font size used which in turn is based on the DateSize variable (set, rather crudely based the screen width, at the start of the code just after the InitGraphics command). The MsgBox$ then auto sizes to accommodate the message text. The Calendar also uses this DateSize value (hence the name) to determine the day button size. Both the MsgBox$ and the Calendar are only drawn once per form being created hidden and then being shown/hidden as required. This was done to avoid graphic objects being created over and over again so clogging up more and more memory. Currently the only way I know of clearing unused graphic objects is via a gr.cls command. This means that it is difficult to change the font once an object has been created as there is no gr.modify command to change the font plus it makes the auto sizing a bit more compilcated.
Hope this all makes sense!
Assuming that you only want to change the overall size of all message boxes I could introduce a new variable (MsgBoxFontSize?) so making the sizes of the MsgBox$ and Calendar individually configurable. This could allow different sized message boxes/calendars on different forms but not different sizes within a form.
I think the MsgBox$ colours could be customisable and is probably best handled via separate API (function call) - SetMsgBoxColours?. This would avoid numerous parameters (5+?) being added to the init gaphics, new form or msgbox$ function calls depending on the required scope of the colours. As "optional" parameters are not allowed they would always have to be coded even when the MsgBox$ is not used.
I think a new "Flat" style for Buttons should be fairly easy to implement - I will look into it.

Note: There is a "feature" in the new ComboBox control which prevents the drop down list appearing if there is less than 10 entries in the list. This has been fixed and will be in the next release.


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Wed Jan 25, 2012 4:22 am 
Offline

Joined: Wed Sep 28, 2011 9:35 am
Posts: 112
Thanks for following up, Jeff.

I've done some modification to the code you use to get screen size, so I'll look over yours a bit more to see if I can resolve the sizing issue. Will get back to you on that one.

Regarding the coloring of the messagebox, that would be quite welcomed by me.


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Wed Jan 25, 2012 2:09 pm 
Offline

Joined: Wed Sep 28, 2011 9:35 am
Posts: 112
Hi Jeff,

messagebox works great in landscape but in portrait it too far right of center. This occurs regardless of the DateSize parameter I use.


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Wed Jan 25, 2012 3:05 pm 
Offline

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
I think the problem with the gr.screen function is that it was/is returning the same screen sizes regardless of the screen orientation e.g. in Landscape mode it should return 960x540 and in Portrait mode it should return 540x960 but the function was/is returning 960x540 all/some of the time.
Can you check the screen size being used by your program is correct for portrait mode?
I think that the correct values are returned on my tablet (at least I've not noticed anything wrong yet!) but on my phone the wrong size is returned (though not always) causing the Calculator to be drawn small and disappearing off the right hand side on the screen.
The DateSize value does no affect the message box position, just the size of the font used and hence the overall size of the message box. Whatever the size it should be positioned in the middle of the screen.


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Thu Jan 26, 2012 1:05 pm 
Offline

Joined: Wed Sep 28, 2011 9:35 am
Posts: 112
Hi Jeff,

I've got the message box showing in portrait properly, though the font is a bit small in it. I might need to scale it a bit. Font in the landscape orientation looks great, though.

Regarding orientation, I've found that the following mod to your code *seems* to help with not returning the wrong coordinates:

Code:
!******************************
!***  I N I T   G R A P H I C S
!******************************
FN.DEF InitGraphics(pAlpha,pColor,pOrientation,pStatusBar)
Bundle.Get 1,"GraphicsOpen",bGraphicsOpen
if bGraphicsOpen=0 then
  lRed=FLOOR( pColor / 65536 )
  lTemp=MOD( pColor,65536 )
  lGreen=FLOOR( lTemp / 256 )
  lBlue=MOD( lTemp,256 )
  gr.open pAlpha,lBlue,lGreen,lRed,pStatusBar

  !***  mod
  gr.render
  !***  end mod 1

  bGraphicsOpen=1
endif
gr.orientation pOrientation
gr.render
gr.screen Width,Height
Bundle.Put 1,"GraphicsOpen",1
Bundle.Put 1,"ScreenWidth",Width
Bundle.Put 1,"ScreenHeight",Height
FN.RTN 0
FN.END


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Fri Jan 27, 2012 12:53 am 
Offline
User avatar

Joined: Thu Dec 15, 2011 1:11 am
Posts: 27
In regard to the "feature" in the new ComboBox, if you use ModCtrlCap to set values, for me anyway, it doesn't seem to matter if you have more or less than 10 values, the drop down still doesn't appear.

Also, how do you control the font of the list it creates? it is about 3 times larger than the control font, and doesnt fit properly in the list area allocated. I can send a screen shot if you like. I tried changing DateSize to no effect.

And lastly, does the list allow for bcSHOWSTATUSBAR being set ? The list seems to get chopped of for me if it does.

_________________
Wallabri via downunder
Samsung Galaxy SII


Top
 Profile  
 
 Post subject: Re: Graphic Controls Generator/Handler
Unread postPosted: Fri Jan 27, 2012 4:04 am 
Offline

Joined: Tue Aug 02, 2011 10:21 am
Posts: 220
The problem was created during the dropdown list area creation (during the DrawForm processing) using whatever list size was present at the time. Using ModCtrlCap after the control has been created would not correct the problem. Hope that explains your problem.

There was a missing set font size command which meant that the dropdown list was drawn using the font size of the last control drawn on the form. I assume/hope in your case it was something with a large font size.

Not sure, but I think this might be a device dependant problem. On my machine the show/hide toolbar option has no effect. I always get a screen size of 1280 x 752 (800 - 48 for the toolbar).
Can you check you are getting the correct screen sizes? It might mean hard coding an adjustment to the screen sizes to fix the problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 129 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 13  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred