MyFbFramework - My FreeBasic Framework

User projects written in or related to FreeBASIC.
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

Added new version:
Version 1.2.8 (May 16, 2021)
- Fixed: Control Destructor in Linux
- Added: RadioButton Checked Property in Linux
- Fixed: ToolBar Button Captions in Linux
- Added: StatusBar Read and Write Property Functions
- Fixed: Icon LoadFromFile
- Added: ImageListClear Export function
- Fixed: UString Len function
- Fixed: StatusBar create crash
- Fixed: Change ListView Column Text
- Added: ImageList Read and Write Property functions
- Added: ImageList Stretch images
- Fixed: ImageList AddFromFile
- Added: Text property to Dictionary
- Added: Canvas Draw transparent
- Added: Top menu separator
- Added: ReadProperty and WriteProperty function to ToolBar
- Added: Selected(Index) property to ListControl
- Fixed: ShowModal
- Fixed: Delete Component
- Added: ToBitmap function to Cursor
- Fixed: LoadIcon
- Added: Form Show normal if is minimized
- Added: Load icon to MenuItem image
- Fixed: Compile without warning in Win64
- Fixed: Reduced number of GDI objects
- Added: Work with image files in Designer
- Fixed: ListView Get SubItem Text
- Added: Sort to ListView
- Added: ToolButtonClick event to ToolBar
- Added: Load from PNG file
- Added: ExtMargins property to Controls
- Added: WantTab property to TextBox
- Fixed: Separator MenuItem Caption
- Fixed: MenuItem Read and Write property function
- Fixed: Form WriteProperty function
- Fixed: Control Repaint function
- Fixed: Panel Paint event
- Fixed: Reallocate functions
- Fixed: Canvas functions
- Added: Object property to Dictionary items
- Added: Chart in Linux
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

Version 1.2.9 (July 14, 2021)
- Fixed: Show windows on DPI sets
- Fixed: CheckBox problem in GroupBox
- Fixed: Default check property of CheckBox
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

Version 1.3.0 (March 18, 2022)
- Improved: ReBar Dark Mode in Linux
- Added: Object parameter to Dictionary IndexOfKey And ContainsOfKey functions
- Added: Dark Mode for ToolTips
- Improved: Dark Mode
- Added: Changing from Dark Mode to HighLight Mode
- Added: DarkMode For OpenFileControl
- Fixed: TextBox DarkMode
- Changed: GroupBox and TextBox Border Color on Dark Mode
- Fixed: MenuItem.Visible property
- Fixed: Compiling with __USE_GTK__
- Fixed: Compiling for Android
- Changed: DarkMode ReBar control to hide white line and ToolBar control to show separator
- Changed: Numbering from _L_ to _L macros
- Fixed: Saving resource files (*.rc) end lines with CRLF
- Fixed: Showing error message on closing IDE
- Improved: The quality of some resources file
- Fixed: ComboBoxEdit and ComboBoxEx ScrollBar Dark Mode
- Fixed: Resources file for Dark Mode
- Added: InStrMatch function
- Fixed: Showing ListView GridLines in Dark mode
- Changed: ListView and TreeListView GridLines Color on Dark mode
- Fixed: StatusBar Erase Background
- Added: DarkMode for ProgressBar
- Added: DarkMode to MenuBar
- Improved: TabControl and StatusBar Dark mode
- Fixed: DarkMode on 64-bit
- Fixed: CheckBox and RadioButton ForeColor property
- Added: Dark Mode
- Fixed: Controls Enabled function on create
- Fixed: Twice OnClick event on the controls in GroupBox
- Fixed: Set TrackBar Position property
- Fixed: Saving ScrollBar Position on Design mode
- Added: EditLabels property to TreeListView
- Fixed: TreeListView Columns Width property
- Changed: ComponentGetBounds procedure from Integer Ptr to Integer
- Fixed: ComboBoxEx Style property and CheckedListBox BackColor property
- Fixed: ComboBoxEx List Height
- Fixed: CheckedListBox AddItem method
- Fixed: ComboBoxEx Text property
- Fixed: OnChange event on ComboBoxEdit
- Fixed: Blinking of the close, maximize, minimize buttons of the form when the mouse over them in Windows 7.
- Changed: Component GetBounds function
- Added: Visible property to TabPage
- Fixed: Activating another form on form activation event in Windows 7.
- Added: Debug print function to save debug log
- Added: InitialDir to FolderBrowserDialog
- Fixed: Destructor on Windows GTK
- Added: CheckBox, RadioButton, MonthCalendar on Android
- Added: Form, Label, Panel, TextBox, CommandButton controls on Android
- Added: Left, Top, Width and Height properties to controls in Android
- Fixed: __USE_GTK__, __USE_WINAPI__ and __USE_JNI__ defines
- Added: __USE_JNI__ define for Android
- Changed: Align property type from Integer to Enum
- Fixed: TextBox LoadFromFile and GetSel method
- Fixed: ComboBoxEdit Text property
- Fixed: TextBox SelText and Control Visible property
- Added: ParentMenuItem property to PopUpMenu
- Added: Private keyword for all types and procedures
- Fixed: TabControl RequestAlign (for TabPages)
- Fixed: Rect and Point types on 64-bit
- Fixed: Form Resizing on Minimized state
- Added: TextBox LeftMargin and RightMargin on Linux
- Added: TextBox LeftMargin and RightMargin properties
- Added: OnDrawItem and OnMeasureItem events to TreeListView
- Fixed: Bitmap and Icon LoadFromResourceName functions
- Fixed: Set system color to RichTextBox
- Added: AddImage function to RichTextBox on Linux
- Added: SelPrint function to RichTextBox
- Added: AddImage functions to RichTextBox
- Added: AddImageFromFile function to RichTextBox on Windows
- Added: RichTextBox SelAlignment, SelBackColor, SelColor, SelBold, SelBullet, SelCharOffset, SelCharSet, SelFontName, SelFontSize, SelIndent, SelItalic, SelProtected, SelRightIndent, SelHangingIndent, SelTabCount, SelUnderline, SelStrikeout properties on Windows and Linux
- Added: RichTextBox Find, FindNext, FindPrev, GetTextRange functions on Linux
- Added: RichTextBox OnProtectChange event on Windows
- Fixed: ToolBar and ReBar
- Added: ReBarBand
- Improved: ReBar moved to Container controls
- Added: ReBar on Windows
- Fixed: Canvas GetPixel, TextWidth and TextHeight functions
- Added: PageScroller on Linux
- Added: PageScroller control on Windows
- Removed: NativeFontControl
- Fixed: HotKey and Form set text property on Linux
- Fixed: Text property of LinkLabel
- Added: Home, End keys, Control and Shift masks to IPAddress control on Linux
- Fixed: IPAddress control Text property
- Added: OnChange and OnFieldChanged events to IPAddress control on Linux
- Added: IPAddress control on Linux
- Added: OnChange event to IPAddress control
- Fixed: IPAddress in Windows
- Added: HotKey Control on Linux
- Added: Resizable property to Header Control and HeaderSection
- Fixed: Header Control Height on Linux
- Added: OnChanging, OnChanged, OnTrack and OnSectionDblClick events to Header control on Linux
- Added: Header control on Linux
- Improved: Filled OpenFileControl Read and Write Property functions
- Added: OpenFileControl
- Added: Grid control in Linux
- Added: MonthCalendar
- Fixed: DateTimePicker Text property on Linux
- Fixed: Changing year and month in DateTimePicker calendar on Linux.
- Fixed: DateTimePicker in Gtk2
- Added: DateTimePicker in Linux
- Added: ShowNone property to DateTimePicker
- Improved: DateTimePicker
- Fixed: Control SetBounds method in Linux
- Fixed: Width and Height properties of Components in Linux
- Added: ToolButton Width and Height property in Linux
- Fixed: Chart sizing in Linux GTK2
- Fixed: Showing Chart Control in Windows
- Fixed: MenuItem Checked property
- Improved: Animate Control supports all media file formats in Windows (including .gif, .mp4 and etc.)
- Added: IsPlaying funtion to Animate control
- Added: OnOpen event of Animate control on Windows and Linux
- Added: OnStart, OnStop and OnClose events to Animate control on Linux
- Added: Animate Control in Linux
- Improved: Filled Animate Read and Write property functions
- Fixed: Compiling with FreeBasic 1.09
- Improved: TreeListView ListItems property and TreeListViewItem Items property names changed to name Nodes
- Fixed: TreeView OnSelChanging event
- Improved: ToolPalette Group collapsed style in Windows
- Improved: Filled TreeListView Read and Write properties
- Removed: SmallImages, GroupHeaderImages and View property of TreeListView
- Fixed: Create TreeListView items in constructor in Windows
- Fixed: TreeNode ImageIndex property
- Fixed: TreeNode SelectedImageIndex property
- Added: Get by index function to Dictionary, OnItemDblClick, OnItemKeyDown and OnSelectedItemChanging events to ListView in Linux
- Added: Images, SelectedImages and EditLabels property to TreeView in Linux, DraggedNode function to TreeView in Linux, OnNodeClick, OnNodeDblClick, OnNodeCollapsing, OnNodeCollapsed, OnNodeExpanding, OnNodeExpanded, OnSelChanging, OnBeforeLabelEdit and OnAfterLabelEdit events to TreeView in Linux
- Added: IsChild property to Control in Linux
- Fixed: TreeView add nodes on Form constructor
- Added: OnNodeCollapsing, OnNodeCollapsed, OnBeforeLabelEdit events to TreeView in Windows
- Fixed: Form OnShow event
- Added: ListView Sort property in Linux, Fixed: ListView View property in Linux
- Fixed: TabPage ImageKey property, PopupMenu ParentWindow property and ListView View property in Linux
- Added: View Property and OnItemClick event to ListView in Linux
- Added: ListView CheckBoxes property and ListViewItem Checked property in Linux
- Added: BorderStyle, AllowColumnReorder and GridLines properties to ListView in Linux
- Fixed: ProgressBar ProcessMessage method
- Fixed: StepBy and StepIt methods of ProgressBar in Linux
- Improved: Filled ProgressBar Read and Write property functions
- Added: TrackBar ClearTickMarks method
- Fixed: ListView SelectedItemIndex property and ListItems.Add function in Linux
- Added: OnScroll and OnChange events to TrackBar in Linux
- Fixed: AddTickMark in tmBoth TickStyle in Linux
- Added: tmManual TickStyle to TrackBar in Linux
- Added: tmBosh style TickMark to TrackBar in Linux
- Removed: Tick property of TrackBar.
- Added: MinValue, MaxValue, Position, LineSize, PageSize, ThumbLength, Frequency, TickStyle and Style property and AddTickMark method to TrackBar in Linux
- Improved: Filled TrackBar Read and Write property function
- Added: BGR function in Linux
- Fixed: BackColor and ForeColor property of Control in Linux
- Fixed: ScrollarBar controls set MaxValue
- Added: BringToFront and SendToBack methods to Control in Linux
- Improved: Filled Read and Write property functions of ScrollBar controls
- Fixed: Set Text property of GroupBox from Property Grid
- Added: Registry functions
- Fixed: TabIndex, TabStop and Text property of TabPage
- Fixed: Text property of ComboBox and ComboBoxEx
- Fixed: Form Constraints property in Linux
- Fixed: Leaking GDI objects
- Added: Contraints property to controls in Linux
- Fixed: Get Top position of controls contained in GroupBox
- Added: SelCount and SelItems properties to ListControl in Linux
- Fixed: Check items of CheckedListBox in Linux
- Fixed: Delete GDI objects
- Fixed: MultiColumn in CheckedListBox
- Changed: Columns property of ListControl and CheckedListBox to name MultiColumn
- Fixed: Filled Read and Write property function of CheckedListBox
- Fixed: CheckedListBox draw focus
- Added: CheckedListBox in Windows
- Added: CheckedListBox control in Linux
- Added: SelItems and SelCount properties to ListControl in Windows
- Improved: ListBox AddItem and InsertItem method
- Improved: ListBox Read and Write property function
- Added: Sort property to ListControl in Linux
- Added: ListControl borders in Linux
- Improved: ComboBoxEx Read and Write property functions
- Removed: AddObject and InsertObject methods from ComboBoxEdit
- Added: OnMouseEnter, OnMouseMove, OnMouseHover, OnMouseLeave events to ComboBoxes in Linux
- Fixed: Control ShowHint property in Linux
- Added: Sort property to ComboBox and ComboBoxEx in Linux
- Added: OnSelectCanceled event to ComboBox in Linux
- Fixed: Grid control
- Fixed: TextBox LoadFromFile method in Linux
- Changed: Control Perform function access type from Public to Protected
- Improved: Private, Protected and Public functions and properties
- Fixed: Label events in Linux
- Fixed: OnDropFile event in GTK2
- Added: OnDropFile event to Control in Linux
- Added: OnActivate, OnActivateApp, OnDeactivate, OnDeactivateApp event to Form in Linux;
- Removed: OnFree, OnTimer event from Form in Linux
- Fixed: ComboBoxEdit ItemHeight property
- Fixed: TextBox in Gtk2
- Added: ListControl SelectAll sub
- Added: OnCopy, OnCut, OnPaste, OnScroll, OnUpdate event and Alignment, CaretPos, CharCase, Ctl3D, Lines, MaskChar, Masked, MaxLength, Modified, ScrollBars, SelEnd, SelLength, SelStart, SelText, TopLine, WantReturn, WantTab properties to TextBox in Linux
- Improved: ImageBox visible in Design mode
- Fixed: TabStop property of Controls
- Added: OnMouseHover event to Control in Linux
- Added: ListView HoverSelection property in Linux
- Fixed: ImageBox OnClik and OnDblClick event in Linux
- Fixed: Select ImageBox in Designer
- Fixed: TextBox WordWraps property in Design Mode
- Fixed: ImageBox events
- Fixed: Bitmap and Graphic LoadFromResourceID functions in Linux
- Added: OnEndScroll event to ListView and TreeListView in Linux
- Fixed: TextBox CutToClipboard, CopyToClipboard, PasteFromClipboard and SelectAll properties
- Fixed: Form Hide property in GTK2 (in Linux)
- Fixed: Hint property of Control
- Added: Form OnHide event in Linux
- Added: Checked property to ListViewItem
- Fixed: ScrollBars and WordWraps properties of TextBox works in design mode
- Added: WordWrap property to Label
- Improved: Form and Control help info
- Fixed: UString Resize
- Fixed: Form ActiveControl property in Design mode
- Fixed: AllowColumnReorder, BorderSelect, CheckBoxes, LabelTip properties of ListView
- Fixed: Color property of ColorDialog
- Added: OnMove event to Controls
- Fixed: Hint property Controls in Linux
- Fixed: Form WindowState in Linux
- Fixed: ImageBox resizing on select image.
- Added: AllowColumnReorder, BorderSelect, CheckBoxes, GridLines, HoverTime, FullRowSelect, LabelTip properties to ListView
- Added: OnMouseEnter event to Controls
- Added: WordWraps property to TextBox in Linux
- Improved: Label Read and Write Property functions
- Fixed: Selecting ListView row when mouse hovers
- Fixed: Form StartPosition property in Linux
- Fixed: TextBox GotFocus and LostFocus event in Linux
- Added: AllowDrop property to Control
- Fixed: Open and Save Dialogs Caption, Filter, FilterIndex, FileName and InitialDir properties in Linux
- Added: Initial changes for MDIForm and MDIChild in Linux
- Fixed: MDIForm and MDIChild properties in Windows
- Removed: NoScale argument from Control.SetMargins and Component.SetBounds
- Added: High DPI compatibility
- Added: TextBox changed event in Linux
- Added: MinExtra to Splitter
- Fixed: Update controls on drag Splitter
- Fixed: Splitter not drags bigger than parent
- Added: SplitterAlignmentConstants enum
- Fixed: Set properties of TextBox and RichTextBox in the PropertyGrid
- Fixed: ListControl AddItem procedure in Linux
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: MyFbFramework - My FreeBasic Framework

Post by oyster »

Thanks

2 questions
1. is it possible to set x or y range for chart by code or in the VisualFBEditor. For example, a chart always sets 0<= y <200 kg even if the current plotting is for rabbits' weight, on the same time, other charts involves in human/horse's weight. A same y-axis range is useful for comparation.

2. is there any other simple(i.e. add/insert columns/rows, set heading text/font, set cell text/font) working grid examples? I have tried `VisualFBEditor.1.3.0\Examples\GridData\frmGridDataTest.vfp`, but I get
17:00:26: Compilation: "E:\prg\BASIC\fb\FreeBASIC-1.09.0-win64\fbc.exe" -b "frmGridDataTest.bas" -exx -v "GridDataTest.rc" -s gui -i "D:\VisualFBEditor.1.3.0/./MyFbFramework"

FreeBASIC Compiler - Version 1.09.0 (2021-12-31), built for win64 (64bit)

Copyright (C) 2004-2021 The FreeBASIC development team.

standalone

target: win64, x86-64, 64bit

backend: gcc

compiling: frmGridDataTest.bas -o frmGridDataTest.c (main module)

D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(780) error 42: Variable not declared, nullptr
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(781) error 1: Argument count mismatch, found 'nullptr'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(791) error 42: Variable not declared, AllowDarkModeForWindow
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(926) error 42: Variable not declared, g_darkModeSupported
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1245) error 9: Expected expression, found 'g_darkModeSupported'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1245) error 3: Expected End-of-Line, found 'g_darkModeSupported'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1257) error 117: ELSE without IF, found 'Else'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1271) error 35: Expected 'END SELECT', found 'End'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1307) error 9: Expected expression, found 'g_darkModeSupported'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1332) error 9: Expected expression, found 'g_darkModeSupported'
D:\VisualFBEditor.1.3.0\MyFbFramework\mff\Control.bas(1332) error 133: Too many errors, exiting


17:00:27: Do not build file. Elapsed Time: 1.19 Seconds
17:00:27: Found Errors (11 Pos)
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

oyster wrote: Mar 21, 2022 9:08 1. is it possible to set x or y range for chart by code or in the VisualFBEditor. For example, a chart always sets 0<= y <200 kg even if the current plotting is for rabbits' weight, on the same time, other charts involves in human/horse's weight. A same y-axis range is useful for comparation.
Added: AxisMax and AxisMin property to Chart control:
https://github.com/XusinboyBekchanov/My ... bb411bae24
oyster wrote: Mar 21, 2022 9:08 2. is there any other simple(i.e. add/insert columns/rows, set heading text/font, set cell text/font) working grid examples?
Example here:
https://github.com/XusinboyBekchanov/Vi ... nt-1447429

Now the font is only for cells.
oyster wrote: Mar 21, 2022 9:08 I have tried `VisualFBEditor.1.3.0\Examples\GridData\frmGridDataTest.vfp`, but I get
Fixed: Compiling GridData example:
https://github.com/XusinboyBekchanov/Vi ... 2cff532257
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: MyFbFramework - My FreeBasic Framework

Post by oyster »

I, a lazybone, hope that someday we can use little code, for example
```
Grid1.Rows.Item(0)->Text(1) = "Row 1 Column 2"
```
becomes
```
Grid1[0, 1] = "Row 1 Column 2"
```
or
```
Grid1[0, 1].text = "Row 1 Column 2"
Grid1[0, 1].font = Font(fontname, fontsize, fontcolor, ...)
Grid1[0, 1].formula = "sum(A1:b5)"
Grid1[0, 1].chart = Image(something)
```
Last edited by oyster on Mar 22, 2022 23:14, edited 1 time in total.
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: MyFbFramework - My FreeBasic Framework

Post by Imortis »

oyster wrote: Mar 22, 2022 15:11 Grid1[0, 1].text = "Row 1 Column 2"
Grid1[0, 1].font = Font(fontname, fontsize, fontcolor, ...)
I imagine this one would be possible with a Property, but it would have to look like this:

Code: Select all

Grid1(0, 1).text = "Row 1 Column 2"
Grid1(0, 1).font = Font(fontname, fontsize, fontcolor, ...)
Just guessing though, as I have not looked at the library in question.
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: MyFbFramework - My FreeBasic Framework

Post by Avata »

How to use the Grid Control? Is there any examples of Grid Control?
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: MyFbFramework - My FreeBasic Framework

Post by oyster »

Avata wrote: Mar 23, 2022 2:33 How to use the Grid Control? Is there any examples of Grid Control?
the author has answered this question, which is asked by me, above
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: MyFbFramework - My FreeBasic Framework

Post by Avata »

Oh, It is trouble got the examples code form github. I paste the code here.

Examples: Grid

Code: Select all

#ifdef __FB_WIN32__
	'#Compile "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/Grid.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Constructor
		
		Dim As Grid Grid1
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.SetBounds 0, 0, 350, 300
		End With
		' Grid1
		With Grid1
			.Name = "Grid1"
			.Text = "Grid1"
			.TabIndex = 0
			.Align = DockStyle.alClient
			.SetBounds 0, 0, 334, 261
			.Parent = @This
			.Columns.Add "Column 1", , 150
			.Columns.Add "Column 2", , 150
			.Columns[1].Tag = @"0"
			.Rows.Add "Row 1 Column 1"
			.Rows.Add "Row 2 Column 1"
			.Rows.Add "Row 3 Column 1"
			.Rows.Add "Row 4 Column 1"
			Grid1[0][1].Text = "Row 1 Column 2"
			Grid1[1][1].Text = "Row 2 Column 2"
			.Rows[2][1].Text = "Row 3 Column 2"
			.Cell(3, 1)->Text = "Row 4 Column 2"
			.Rows[3].Tag = @"1"
		End With
	End Constructor
	
	Dim Shared Form1 As Form1Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form1.Show
		
		App.Run
	#endif
'#End Region
Examples: Header

Code: Select all

#ifdef __FB_WIN32__
	'#Compile "Form1.rc"
#endif
'#Region "Form"
	#define __USE_GTK3__
	#include once "mff/Form.bi"
	#include once "mff/Header.bi"
	#include once "mff/ImageList.bi"
	
	Using My.Sys.Forms
	
	Type Form1Type Extends Form
		Declare Constructor
		
		Dim As ImageList ImageList1
		Dim As Header Header1
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.SetBounds 0, 0, 350, 300
		End With
		' ImageList1
		With ImageList1
			.Name = "ImageList1"
			.SetBounds 40, 120, 36, 46
			.Parent = @This
			.Add "About", "About"
			.Add "Add", "Add"
		End With
		' Header1
		With Header1
			.Name = "Header1"
			.Text = "Header1"
			.Images = @ImageList1
			.SetBounds 0, 0, 350, 90
			.Parent = @This
			.AddSection "Header Section 1", "About", 100
			.AddSection "Header Section 2", "Add", 100
		End With
	End Constructor
	
	Dim Shared Form1 As Form1Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form1.Show
		
		App.Run
	#endif
'#End Region
Last edited by Avata on Mar 24, 2022 1:18, edited 1 time in total.
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

oyster wrote: Mar 22, 2022 15:11 Grid1[0, 1].text = "Row 1 Column 2"
Grid1[0, 1].font = Font(fontname, fontsize, fontcolor, ...)
Added: GridCell to Grid control and Added: Grid Example
https://github.com/XusinboyBekchanov/My ... fd5b3684b4

Now with the new change it might work like this:

Code: Select all

With Grid1
	.Name = "Grid1"
	.Text = "Grid1"
	.TabIndex = 0
	.Align = DockStyle.alClient
	.SetBounds 0, 0, 334, 261
	.Parent = @This
	.Columns.Add "Column 1", , 150
	.Columns.Add "Column 2", , 150
	.Columns[1].Tag = @"0"
	.Rows.Add "Row 1 Column 1"
	.Rows.Add "Row 2 Column 1"
	.Rows.Add "Row 3 Column 1"
	.Rows.Add "Row 4 Column 1"
	Grid1[0][1].Text = "Row 1 Column 2"
	Grid1[1][1].Text = "Row 2 Column 2"
	.Rows[2][1].Text = "Row 3 Column 2"
	.Cell(3, 1)->Text = "Row 4 Column 2"
	.Rows[3].Tag = @"1"
End With
Imortis wrote: Mar 22, 2022 15:34 I imagine this one would be possible with a Property, but it would have to look like this:

Code: Select all

Grid1(0, 1).text = "Row 1 Column 2"
Grid1(0, 1).font = Font(fontname, fontsize, fontcolor, ...)
Just guessing though, as I have not looked at the library in question.
I don't think it's possible to do this with a type.
Avata
Posts: 102
Joined: Jan 17, 2021 7:27

Re: MyFbFramework - My FreeBasic Framework

Post by Avata »

Examples: Cavas Drawing
why the third Rectangle filling does not like HS_DIAGCROSS and the forth Rectangle filling does not like HS_Vertical

Code: Select all

#ifdef __FB_WIN32__
	''#Compile "Form1.rc"
#endif
'#Region "Form"
	#include once "mff/Form.bi"
	#include once "mff/Label.bi"
	#include once "mff/CommandButton.bi"
	#include once "mff/Picture.bi"
	#include once "mff/Textbox.bi"
	#include once "mff/Pen.bi"
	#include once "mff/ListControl.bi"
	Using My.Sys.Forms
	Using My.Sys.Drawing
	
	Type Form1Type Extends Form
		Declare Static Sub CommandButton1_Click_(ByRef Sender As Control)
		Declare Sub CommandButton1_Click(ByRef Sender As Control)
		Declare Static Sub Picture1_Paint_(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
		Declare Sub Picture1_Paint(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
		Declare Static Sub Form_Resize_(ByRef Sender As Control, NewWidth As Integer, NewHeight As Integer)
		Declare Sub Form_Resize(ByRef Sender As Control, NewWidth As Integer, NewHeight As Integer)
		Declare Static Sub cmdGDIDraw_Click_(ByRef Sender As Control)
		Declare Sub cmdGDIDraw_Click(ByRef Sender As Control)
		Declare Static Sub cmdGDICls_Click_(ByRef Sender As Control)
		Declare Sub cmdGDICls_Click(ByRef Sender As Control)
		Declare Static Sub CommandButton2_Click_(ByRef Sender As Control)
		Declare Sub CommandButton2_Click(ByRef Sender As Control)
		Declare Static Sub cmdGDIDraw1_Click_(ByRef Sender As Control)
		Declare Sub cmdGDIDraw1_Click(ByRef Sender As Control)
		Declare Static Sub Form_Click_(ByRef Sender As Control)
		Declare Sub Form_Click(ByRef Sender As Control)
		Declare Constructor
		
		Dim As CommandButton CommandButton1, cmdGDIDraw, cmdGDICls
		Dim As Picture Picture1
		Dim As TextBox Text1(1), Text2(1), Text3(1), Text4(1), Text5(1)
	End Type
	
	Constructor Form1Type
		' Form1
		With This
			.Name = "Form1"
			.Text = "Form1"
			.Designer = @This
			.OnResize = @Form_Resize_
			.OnClick = @Form_Click_
			.SetBounds 0, 0, 350, 300
		End With
		' CommandButton1
		With CommandButton1
			.Name = "CommandButton1"
			.Text = "Start Draw"  '"开始绘画"
			.TabIndex = 1
			.Anchor.Bottom = AnchorStyle.asAnchor
			.Anchor.Top = AnchorStyle.asNone
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Right = AnchorStyle.asNone
			.SetBounds 13, 230, 71, 30
			.Designer = @This
			.OnClick = @CommandButton1_Click_
			.Parent = @This
		End With
		' Picture1
		With Picture1
			.Name = "Picture1"
			.Text = "Picture1"
			.TabIndex = 1
			.Anchor.Top = AnchorStyle.asAnchor
			.Anchor.Right = AnchorStyle.asAnchor
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.BackColor = 8388736
			.SetBounds 12, 56, 310, 170
			.Designer = @This
			.OnPaint = @Picture1_Paint_
			.Parent = @This
		End With
		' Text1(0)
		With Text1(0)
			.Name = "Text1(0)"
			.Text = "1"
			.TabIndex = 2
			.SetBounds 20, 0, 40, 20
			.Parent = @This
		End With
		' Text2(0)
		With Text2(0)
			.Name = "Text2(0)"
			.Text = "2"
			.TabIndex = 3
			.SetBounds 80, 0, 40, 20
			.Parent = @This
		End With
		' Text3(0)
		With Text3(0)
			.Name = "Text3(0)"
			.Text = "4"
			.TabIndex = 4
			.SetBounds 150, 0, 40, 20
			.Parent = @This
		End With
		' Text4(0)
		With Text4(0)
			.Name = "Text4(0)"
			.Text = "12"
			.TabIndex = 5
			.SetBounds 210, 0, 40, 20
			.Parent = @This
		End With
		' Text5(0)
		With Text5(0)
			.Name = "Text5(0)"
			.Text = "5"
			.TabIndex = 6
			.SetBounds 280, 0, 40, 20
			.Parent = @This
		End With
		' Text1(1)
		With Text1(1)
			.Name = "Text1(1)"
			.Text = "1"
			.TabIndex = 7
			.SetBounds 20, 30, 40, 20
			.Parent = @This
		End With
		' Text2(1)
		With Text2(1)
			.Name = "Text2(1)"
			.Text = "2"
			.TabIndex = 8
			.SetBounds 80, 30, 40, 20
			.Parent = @This
		End With
		' Text3(1)
		With Text3(1)
			.Name = "Text3(1)"
			.Text = "4"
			.TabIndex = 9
			.SetBounds 150, 30, 40, 20
			.Parent = @This
		End With
		' Text4(1)
		With Text4(1)
			.Name = "Text4(1)"
			.Text = "12"
			.TabIndex = 10
			.SetBounds 210, 30, 40, 20
			.Parent = @This
		End With
		' Text5(1)
		With Text5(1)
			.Name = "Text5(1)"
			.Text = "5"
			.TabIndex = 11
			.SetBounds 280, 30, 40, 20
			.Parent = @This
		End With
		' cmdGDIDraw
		With cmdGDIDraw
			.Name = "cmdGDIDraw"
			.Text = "Scale"
			.TabIndex = 12
			.Anchor.Top = AnchorStyle.asNone
			.Anchor.Bottom = AnchorStyle.asAnchor
			.Anchor.Right = AnchorStyle.asNone
			.Anchor.Left = AnchorStyle.asAnchor
			.SetBounds 86, 231, 79, 30
			.Designer = @This
			.OnClick = @cmdGDIDraw_Click_
			.Parent = @This
		End With
		' cmdGDICls
		With cmdGDICls
			.Name = "cmdGDICls"
			.Text = "Cls"
			.TabIndex = 13
			.Caption = "Cls"
			.Anchor.Left = AnchorStyle.asAnchor
			.Anchor.Bottom = AnchorStyle.asAnchor
			.SetBounds 170, 232, 79, 30
			.Designer = @This
			.OnClick = @cmdGDICls_Click_
			.Parent = @This
		End With
	End Constructor
	
	Private Sub Form1Type.Form_Click_(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).Form_Click(Sender)
	End Sub
 
	Private Sub Form1Type.CommandButton2_Click_(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).CommandButton2_Click(Sender)
	End Sub
	
	Private Sub Form1Type.cmdGDICls_Click_(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).cmdGDICls_Click(Sender)
	End Sub
	
	Private Sub Form1Type.cmdGDIDraw_Click_(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).cmdGDIDraw_Click(Sender)
	End Sub
	
	Private Sub Form1Type.Form_Resize_(ByRef Sender As Control, NewWidth As Integer, NewHeight As Integer)
		*Cast(Form1Type Ptr, Sender.Designer).Form_Resize(Sender, NewWidth, NewHeight)
	End Sub
	
	Private Sub Form1Type.Picture1_Paint_(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
		*Cast(Form1Type Ptr, Sender.Designer).Picture1_Paint(Sender, Canvas)
	End Sub
	
	Private Sub Form1Type.CommandButton1_Click_(ByRef Sender As Control)
		*Cast(Form1Type Ptr, Sender.Designer).CommandButton1_Click(Sender)
	End Sub
	
	Dim Shared Form1 As Form1Type
	
	#ifndef _NOT_AUTORUN_FORMS_
		#define _NOT_AUTORUN_FORMS_
		
		Form1.Show
		
		App.Run
	#endif
'#End Region

Private Sub Form1Type.CommandButton1_Click(ByRef Sender As Control)
	Dim As Double A(1), B(1), C(1), D(1), E(1), X, Y
	Dim T As Long = GetTickCount
	' Coordination  坐标系统
	CommandButton1.Caption = "Waiting......Drawing"  '"稍等,正在绘画"     '"Waiting......Drawing" '
	'Picture1.Visible = False
	Picture1.Style = 16
	With Picture1.Canvas
		.CreateDoubleBuffer
		.Cls 
		.Scale(-10, -10, 10, 10)
		.Pen.Color = clGreen
		.Pen.Size = 2
		.Pen.Style = 3 'PenStyle.psDashDot
		'.Pen.Mode = PenMode.pmMerge
		' draw across  画十字线条
		'.FillMode = BrushFillMode.bmOpaque  
		'.Brush.Style = BrushStyles.bsSolid 
		'.Rectangle -10 , -10 , 10 , 10
		'.Line -10 , -10 , 10 , 10, clblue, "BF"
		.Line -10 , 0 , 10 , 00
		.Line 0 , -10 , 0 , 10
		.TextOut 10 , 0, "1", clGreen , -1
		.TextOut 10, 20 - 2, "2", clGreen , -1
		.TextOut 00 , 10, "3", clGreen , -1
		.TextOut 20 - 3 , 1000, "4", clGreen , -1
		.TextOut 1 , 1, "0", clGreen , -1
		
		' drawing arrow  化箭头
		'    .Line 0 , 1000 , -125 , 950
		'    .Line 0 , 1000 , 125 , 950
		'    .Line 1000 , 0 , 950 , 125
		'    .Line 1000 , 0 , 950 , -125
		'
		A(0) = Val(Text1(0).Text): A(1) = Val(Text1(1).Text)
		B(0) = Val(Text2(0).Text): B(1) = Val(Text2(1).Text)
		C(0) = Val(Text3(0).Text): C(1) = Val(Text3(1).Text)
		D(0) = Val(Text4(0).Text): D(1) = Val(Text4(1).Text)
		E(0) = Val(Text5(0).Text): E(1) = Val(Text5(1).Text)
		'
		If A(0) < 1 Then A(0) = 1: If A(1) < 1 Then A(1) = 1
		If D(0) < 1 Then D(0) = 1: If D(1) < 1 Then D(1) = 1
		If E(0) < 1 Then E(0) = 1: If E(1) < 1 Then E(1) = 1
		
		For i As Long = -72000 To 72000 'Step  0.1
			x = (Sin(i * A(0)) * (Exp(Cos(i)) - B(0) * Cos(C(0) * i) - Sin(i / D(0)) ^ E(0)))
			y = (Cos(i * A(1)) * (Exp(Cos(i)) - B(1) * Cos(C(1) * i) - Sin(i / D(1)) ^ E(1)))
			.SetPixel x, y, clRed
			'.TextOut 20, 20, Str(i), clYellow, -1
		Next
		.TextOut - 9, -9, "Elapsed Time: " & GetTickCount - t & "ms", clGreen , -1 '"用时 " & GetTickCount - t & "毫秒", clGreen , -1
		'Picture1.Visible = True
		.DeleteDoubleBuffer
	End With
	
	CommandButton1.Caption = "Start Draw" '"开始绘画"    '"Start Draw" 
	'
End Sub

Private Sub Form1Type.Picture1_Paint(ByRef Sender As Control, ByRef Canvas As My.Sys.Drawing.Canvas)
	'CommandButton1_Click(sender)
End Sub

Private Sub Form1Type.Form_Resize(ByRef Sender As Control, NewWidth As Integer, NewHeight As Integer)
	
End Sub

Private Sub Form1Type.cmdGDIDraw_Click(ByRef Sender As Control)
	Picture1.Style = 16
	With Picture1.Canvas
		.CreateDoubleBuffer
		.Cls 
		.Scale(-100, 100, 100, -100)
		.Pen.Color = clGreen
		.Pen.Size = 1
		.Pen.Style = 3 'PenStyle.psDashDot
		'Print Picture1.BackColor
		.FillMode = BrushFillMode.bmTransparent
		.Line (-100, 0, 100, 0) '画X轴
		.Line (0, 100, 0, -100) '画Y轴
		
		.Brush.Style = BrushStyles.bsSolid
		.Circle (0, 0, 5) '绘制红色圆心
		.Brush.Style = BrushStyles.bsClear
		
		.TextOut 0,  0, "(0,0)" , clGreen, -1 '原点坐标
		.TextOut 90, 10, "X轴", clGreen, -1    '标记X轴
		.TextOut 5, 95,  "Y轴", clGreen, -1     '标记Y轴
		
		For i As Integer = 10 To 50 Step 4
			.SetPixel(i, 10, clRed) '绘制像素点
		Next
		
		'绘制不同模式的直线
		.DrawWidth = 1 '设置画笔宽度
		.Pen.Style = PenStyle.psSolid
		.Line(-10, -10, -100, -10)
		
		.Pen.Style = PenStyle.psDash
		.Line(-10, -20, -100, -20)
		
		.Pen.Style = PenStyle.psDashDot
		.Line -10, -30, -100, -30
		
		.Pen.Style = PenStyle.psDashDotDot
		.Line -10, -40, -100, -40
		
		.Brush.Style = BrushStyles.bsSolid  
		.Line 40, 20, 80, 40, , "F"
		.Line 40, 70, 80, 90, clBlue, "F"
		
		.DrawWidth = 2 '设置画笔宽度
		.Pen.Style = 0
		'绘制弧线、弦割线、饼图
		.Arc(30, 50, 70, 80, 70, 60, 30, 60)
		.Chord(10, 60, 40, 80, 40, 60, 10, 70)
		.Pie(20, 70, 40, 50, 60, 80, 40, 60)
		
		Dim As Point pt(4) = {(-60, + 20), (-90, + 110), (-10, 0), (-30, 70)}
		'{{90, 130}, {60, 40}, {140, 150}, {160, 80}}
		'//绘制椭圆、矩形
		.Ellipse(pt(0).X, pt(0).y, pt(1).X, pt(0).y)
		.Rectangle(pt(2).X, pt(2).y, pt(3).X, pt(3).y)
		
		'绘制贝塞尔曲线
		.Pen.Color = clRed
		.DrawWidth = 2  'DrawWidth
		.PolyBeizer(pt(), 4)
		'标出贝塞尔曲线的四个锚点
		.Circle(pt(0).x, pt(0).y, 4)
		.Circle(pt(1).x, pt(1).y, 4)
		.Circle(pt(2).x, pt(2).y, 4)
		.Circle(pt(3).x, pt(3).y, 4)
		
		'绘制圆
		.Circle(50, 40, 30, clYellow)
		
		'绘制不同填充模式的矩形
		.Pen.Size = 1
		.Pen.Color = clGreen
		.Brush.Color = clRed
		.Brush.Style = BrushStyles.bsClear
		.FillColor = clBlue
		.Rectangle(20, -20, 60, -30) ' HS_BDIAGONAL, RGB(255, 0, 0))
		.Brush.Color = clRed
		.Brush.Style = BrushStyles.bsHatch
		.Brush.HatchStyle = HatchStyles.hsCross
		.Rectangle(20, -40, 60, -50) ' HS_CROSS, RGB(0, 255, 0));
		.Pen.Color = clGreen
		.FillColor = clYellow
		.Brush.HatchStyle = HatchStyles.hsDiagCross
		.FillColor = clYellow
		.Rectangle(20, -60, 60, -70) ' HS_DIAGCROSS, RGB(0, 0, 255))
		.Pen.Color = clYellow
		.Brush.HatchStyle = HatchStyles.hsVertical
		.FillColor = clGray 
		.Rectangle(20, -80, 60, -90) ' HS_VERTICAL, RGB(0, 0, 0))
		
		'Draw Image   绘制位图
		'StretchDraw(10, 140, 180, 100, TEXT("chenggong.bmp"))
		
		'绘制文本
		'TextOut(20, 220, TEXT("GDI画图输出测试程序"), 11);
		.DeleteDoubleBuffer
	End With
End Sub

Private Sub Form1Type.cmdGDICls_Click(ByRef Sender As Control)
	With Picture1.Canvas
		.Cls(50, -20, 60, -40)
		Sleep(300)
		.Cls
	End With
End Sub

Private Sub Form1Type.Form_Click(ByRef Sender As Control)
	
End Sub

Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

Avata wrote: Mar 28, 2022 7:56 Examples: Cavas Drawing
why the third Rectangle filling does not like HS_DIAGCROSS and the forth Rectangle filling does not like HS_Vertical
Fixed: FillColor property of Canvas:
https://github.com/XusinboyBekchanov/My ... 92e1a2677c
Xusinboy Bekchanov
Posts: 783
Joined: Jul 26, 2018 18:28

Re: MyFbFramework - My FreeBasic Framework

Post by Xusinboy Bekchanov »

Version 1.3.1 (March 31, 2022)
- Added: OnMoving event to Splitter
- Added: SeriesCount and AxisItemsCount functions to Chart control
- Fixed: Chart UpdateSerie with animation
- Fixed: Chart UpdateSerie method
- Fixed: Control Parent property
- Added: FillColor and FillMode property to Canvas
- Removed: Picture Canvas field, Picture control gets Canvas field from Base type
- Fixed: Drawing with BackColor on Canvas
- Improved: Canvas Line function
- Fixed: Add Circle function to Canvas
- Fixed: WebBrowser Segmentation violation signal
- Fixed: Compiling GridData control
- Added: GridData control
- Added: Canvas BackColor property for Cls method
- Added: ToolTipsFormat property to Chart control
- Fixed: LabelsPositions and LabelsAlignments properties of Chart control
- Added: LabelsFormat property to Chart control
- Added: Cell function to Grid control
- Added: Tag Property to GridColumn
- Added: Grid Example
- Added: GridCell to Grid control
- Added: ButterflyDraw example
- Fixed: Hello Example compiling
- Added: Scale and Cls function to Canvas
- Fixed: Showing Double values in Chart control
- Fixed: High DPI Chart, Grid, ListView and TreeListView controls
- Fixed: Chart control without data
- Added: Scale function to Canvas on Windows
- Added: SelectedColumnIndex property to Grid control
- Added: Dark mode for Grid control
- Added: AxisMax and AxisMin property to Chart control
- Added: CountOf function to WStringList
- Added: CreateDoubleBuffer, TransferDoubleBuffer and DeleteDoubleBuffer methods to Canvas
- Improved: Canvas SetPixel method and Changed: GetDevice and ReleaseDevice method visibility from Private: to Public:
- Fixed: OpenFileControl crash on Design Mode
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: MyFbFramework - My FreeBasic Framework

Post by oyster »

is it possible to use `mff32.dll` in other language, for example, python?
Post Reply