PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7 ... 10
 41 
 on: April 07, 2021, 12:02:46 PM 
Started by Petrus Vorster - Last post by Paul Squires
Hi Peter,

I dug out my old code for the excel sll and found the following in my test code file. Looks like I had designed the api so that you can output a date. Take a look at the following (I am copying this directly from my test file):

Code: [Select]
    'write a date to the file. Dates can be written as literal text strings but doing so will not allow
    'the date to be formatted. The date will be eventually written as a number after conversion to a
    'Julian date number.
    'Write todays date..... Use format #12 mm/dd/yy (you can change the different formats by modifying
    'the code in xlsWriteDefaultFormats. The date is expected to be in the YYYYMMDD format. You can convert
    'from mm-dd-yyyy format to YYYYMMDD by calling the CTOD$ function.
    mDate$ = CTOD$(DATE$)
    stat& = xlsWriteDate(mDate$, 15, 1, %xlsFont1, %xlsLeftAlign, %xlsCellNormal, 12)
   
    mDate$ = "19991128"
    stat& = xlsWriteDate(mDate$, 16, 1, %xlsFont1, %xlsLeftAlign, %xlsCellNormal, 13)

    mDate$ = "20000331"
    stat& = xlsWriteDate(mDate$, 17, 1, %xlsFont1, %xlsLeftAlign, %xlsCellNormal, 14)
   
    mDate$ = "20010630"
    stat& = xlsWriteDate(mDate$, 18, 1, %xlsFont1, %xlsLeftAlign, %xlsCellNormal, 15)

    mDate$ = "19991023"
    stat& = xlsWriteDate(mDate$, 19, 1, %xlsFont1, %xlsLeftAlign, %xlsCellNormal, 20)


 42 
 on: April 07, 2021, 11:40:21 AM 
Started by Bumblebee - Last post by Bumblebee
I may not have noticed this before, but does the listbox support unicode characters?
Using the latest version 2.2.0

e.g. Élégance is displayed as ÉlĂ©gance

 43 
 on: April 07, 2021, 11:26:09 AM 
Started by Petrus Vorster - Last post by Petrus Vorster
Hi gents

I made a little tool for our auditors that extract info from TXT reports from a real lame system.
Works like a charm, and simply finds the correct info and puts it in an Excel sheet.

I figured out how to send TEXT and Currencies/Numeric to the Excel sheet using Paul's Excel.Sll
Marvelous tool still.( Thanks Paul)

Unfortunately, it also needs to send a DATE in such a way that EXCEL will recognize it as a DATE and not TEXT.
The manual formatting in Excel later consumes copious amounts of time that the team don't have.
The reason is that we must sort those sheets in User Names and then DATE order and that wont work unless Excel recognizes the column as a date.

In time I will try and do that sorting in the tool, but for now I just need to know how to pass the DATE correctly to EXCEL.Sll

If someone here is still keeping their PB projects around.

Regards, Peter


 44 
 on: April 06, 2021, 07:45:33 PM 
Started by ji_vildaasen - Last post by Paul Squires
Lol, yes I did forget! I am getting old and forgetful. You have already built the wheel.  I just need to use it.  :-)


 45 
 on: April 06, 2021, 05:14:01 PM 
Started by ji_vildaasen - Last post by José Roca
> This would be a prime case where WinFBE could use a dedicated built-in control like a "Canvas Control" or "Graphic Drawing Control".   :-)

You have forgot that WinFBX has a graphic control, CGraphCtx, that allows to work with GDI, GDI+ and OpenGL? It also features persistence and flicker free resizing (it uses double buffering). And there are hundreds of GDI+ examples (in the Examples/CGdiPlus folder) that use it (and are DPI aware).

See: https://github.com/JoseRoca/WinFBX/blob/master/docs/Graphics/CGraphCtx%20Class.md

 46 
 on: April 06, 2021, 03:11:01 PM 
Started by ron77 - Last post by Paul Squires
If you don't want to use a 3rd party control like Scintilla to do your syntax coloring then you should investigate syntax coloring via a RichEdit control.  https://www.freebasic.net/forum/viewtopic.php?f=6&t=28802&p=276311

I do have a custom control about 80% written in FB that does syntax highlighting but it is not in a state that I can release. Maybe I will at some point in case another programmer would like to help enhance it. It is basically a stripped down version of Scintilla.

 47 
 on: April 06, 2021, 03:05:30 PM 
Started by ji_vildaasen - Last post by Paul Squires
Hi, I downloaded your example but I have zero experience with FB's ScreenRes and built in graphics controls. I doubt that the FB graphic control exposes a Windows handle so it doesn't act like a normal Windows child control, therefore even adding the WS_CLIPCHILDREN style would not excluded it from the drawing region and thus contributes to flicker.

Being a Windows programmer, I would approach this by creating a custom control by creating a simple blank window via CreateWindowEx and then return TRUE from WM_ERASEBKGND and do all of the drawing in the WM_PAINT message handler and use double buffering and primitive GDI or GDI+ api commands. This requires a bit of knowledge about how to create custom controls but you can look in the Afx folder and find several from Jose (eg. CxpButton.inc).

This would be a prime case where WinFBE could use a dedicated built-in control like a "Canvas Control" or "Graphic Drawing Control".   :-)



 48 
 on: April 06, 2021, 12:50:31 PM 
Started by ron77 - Last post by ron77
hello i'm trying to add code syntax highlights to freebasic code in my text editor... i found a code that prints to the screen console a content of a bas file with syntax highlight but i don't know how to modify it in order to print bas code of freebasic into the text editor textbox...

here is the code i found:
https://pastebin.com/SmyNcLDH


any help will be appreciated
ron77

 49 
 on: April 05, 2021, 12:00:04 PM 
Started by ji_vildaasen - Last post by ji_vildaasen
Hi

I'm trying to put together some code to easily draw a FreeBasic ImageBuffer that the internal gfx library uses, in a WinFBE project. I have working code that shows a ImageBuffer drawn on a Window, but I'm hoping someone has some good tips to avoid flickering when the window gets resized.

Here is the code that draws the FB Imagebuffer, it gets called when the Window gets a WM_PAINT message:
Code: [Select]
Sub FBImageBox.Draw()

PrintMSG "FBImageBox.Draw()"

If Buffer = 0 then exit sub
If TempBuffer = 0 Then TempBuffer = ImageCreate(MaxW, MaxH, 0, 32)

Put TempBuffer, (0, 0), Buffer, Pset

Dim As BITMAPV4HEADER bmi

With BMI
.bV4Size = Len(BITMAPV4HEADER)
.bv4width = TempBuffer->Pitch / 4
.bv4height = -(TempBuffer->Height)
.bv4planes = 1
.bv4bitcount = 32
.bv4v4compression = 0
.bv4sizeimage = ((TempBuffer->Pitch / 4) * TempBuffer->Height) * 4
.bV4RedMask = &h0f00
.bV4GreenMask = &h00f0
.bV4BlueMask = &h000f
.bV4AlphaMask = &hf000
End With

Var hdc = GetDC(Parent.hWindow)
StretchDIBits(hDC, x, y, Buffer->Width, Buffer->Height, 0, 0, Buffer->Width, Buffer->Height, CPtr(Any Ptr, TempBuffer) + SizeOf(FB.Image), CPtr( BITMAPINFO Ptr, @BMI), DIB_RGB_COLORS, SRCCOPY )
DeleteDC(hdc)

end sub

Most of the code I think I found on the FB forum years ago, I have also attached a test WinFBE project if anyone is interested.

PS: Is there an option in WinFB to save the code the way it is displayed?

 50 
 on: April 04, 2021, 04:02:35 PM 
Started by James Klutho - Last post by James Klutho
Excellent.  I missed that.

Pages: 1 ... 3 4 [5] 6 7 ... 10