BBC BASIC for Windows
« Rich Edit controls »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:06am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Rich Edit controls  (Read 958 times)
Nick
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 33
xx Re: Rich Edit controls
« Reply #2 on: Aug 31st, 2011, 9:56pm »

on Aug 31st, 2011, 9:32pm, Richard Russell wrote:
If you declare the structure in BBC BASIC code you can find the length using the DIM function, thus:


Thanks Richard - that is helpful (and thinking about it, now obvious! Sorry!)

With a statement in BBC4W that makes a call and puts the result in memory, is there an easy way to tell precisely how many bytes were returned to the memory space?

I presume that if you have allocated, say, 64 bytes, but the system returns void or false, then most of your allocated memory will NOT contain the data you expect!

Is there a way to tell this with a call such as:

SYS "SendMessage", hRichEdit%, EM_GETPARAFORMAT, 0, F%

Or is there an easier way to get the SYS call to put the data directly into a variable? The WinAPI says that the lparam should be a "Pointer to a PARAFORMAT structure that receives the paragraph formatting attributes of the current selection. "

I suppose I am asking "Is there a way to present the SYS call lparam so that it seems like an accessible structure to the Rich control, but is also a variable within your BBC prog?"

Thanks again

Nick

User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Rich Edit controls
« Reply #3 on: Sep 1st, 2011, 08:12am »

on Aug 31st, 2011, 9:56pm, Nick wrote:
With a statement in BBC4W that makes a call and puts the result in memory, is there an easy way to tell precisely how many bytes were returned to the memory space?

No, there's no way of knowing unless the API call itself returns that information (several do).

Quote:
I suppose I am asking "Is there a way to present the SYS call lparam so that it seems like an accessible structure to the Rich control, but is also a variable within your BBC prog?"

I'm not sure I fully understand the question, but you should be using the API as follows:

Code:
      DIM paraformat2{cbSize%, dwMask%, wNumbering{l&,h&}, wEffects{l&,h&}, \
      \ dxStartIndent%, dxRightIndent%, dxOffset%, wAlignment{l&,h&}, \
      \ cTabCount{l&,h&}, rgxTabs%, dySpaceBefore%, dySpaceAfter%, dyLineSpacing%, \
      \ sStyle{l&,h&}, bLineSpacingRule&, bOutlineLevel&, wShadingWeight{l&,h&}, \
      \ wShadingStyle{l&,h&}, wNumberingStart{l&,h&}, wNumberingStyle{l&,h&}, \
      \ wNumberingTab{l&,h&}, wBorderSpace{l&,h&}, wBorderWidth{l&,h&}, wBorders{l&,h&}}
      
      EM_GETPARAFORMAT = &43D
      paraformat2.cbSize% = DIM(paraformat2{})
      SYS "SendMessage", hRichEdit%, EM_GETPARAFORMAT, 0, paraformat2{} 

Richard.
User IP Logged

Nick
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 33
xx Re: Rich Edit controls
« Reply #4 on: Sep 1st, 2011, 1:33pm »

OK - Thanks. That is helpful.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls