multitab editor

(Updates to FBSL Editors, RAD and Related Stuff)

multitab editor

Unread postby ferdinad_piatnik » Wed Mar 01, 2006 1:04 am

Hi!

I was inspired by Danny's Fbsl_Ide Special Edition based on CS30.dll.

I'm trying to learn GUI. It's much easier to start with some existing code than from scratch, so i took liberty to reuse Danny's script (thanks) . I made few changes to enable multiple tabs. I added option "compile with includes". I'm not very familiar with GUI, I'm sure things can be done much better.
There are some problems. Menus change color, tooltips disappear,
I don't know how to destroy "codesense" control...

I tested program on Windows XP only.

Best regards

*** Deleted old upload ***
Last edited by ferdinad_piatnik on Thu Mar 16, 2006 5:29 pm, edited 1 time in total.
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Re: multitab editor

Unread postby Gerome » Wed Mar 01, 2006 1:14 am

Hi Ferdinand,

Not so bad :)
It works onto Win2k also without problem :)
Thanks for this first attempt, i'm sure you'll be sooner as good at GUI as you've shown us your 2D arrays capabilities :)
Keep up your good work, don't hesitate to post any attempts! :)
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

Re: multitab editor

Unread postby Danny_J » Wed Mar 01, 2006 3:44 am

ferdinad_piatnik wrote:Hi!

I was inspired by Danny's Fbsl_Ide Special Edition based on CS30.dll.

I'm trying to learn GUI. It's much easier to start with some existing code than from scratch, so i took liberty to reuse Danny's script (thanks) . I made few changes to enable multiple tabs. I added option "compile with includes". I'm not very familiar with GUI, I'm sure things can be done much better.
There are some problems. Menus change color, tooltips disappear,
I don't know how to destroy "codesense" control...

I tested program on Windows XP only.

Best regards


Great Work :!:

To unregister the control add this line to your exit routine:

Code: Select all
CMUnregisterControl(0)
With warmest regards,

Danny

http://dannyj.codernet.net/
User avatar
Danny_J
FBSL geek
FBSL geek
 
Posts: 137
Joined: Mon Mar 14, 2005 6:54 pm
Location: United States

Re: multitab editor

Unread postby ferdinad_piatnik » Wed Mar 01, 2006 9:09 am

Hi!
Danny_J wrote:
To unregister the control add this line to your exit routine:

Code: Select all
CMUnregisterControl(0)


I do this on exit.
Each editor tab is associated with an CodeMax editor object which I don't know how to release/destroy. Destroy() function produces program crash. Therefore I reuse those editor object on next opening of tab. This leads to some undesired effects - Some settings from previous use (like screen spliting...) remain in effect).

Best regards

I fixed a bug:
After closing "Untitled.fbs in first tab next tab was opened as tab(0) and therfore not accessible.
Added link to forum under Help menu.

*** Deleted old upload ***
Last edited by ferdinad_piatnik on Thu Mar 16, 2006 5:30 pm, edited 1 time in total.
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Unread postby ferdinad_piatnik » Thu Mar 09, 2006 1:27 am

Hi!

I worked little on my version of "CS30.dll" based FBSL editor.
I like to reuse existing software.
CS30.dll enables "column mode select", window splitting and lot of other
editing possibilities. I included a help page with list of editor keyboard and mouse functions.
My added features are:
-possibility to open multiple files
-detecting of supported file types(fbs/inc,htm/html,xml,c,pas,bas,sql,java/js)
-compile with includes - merges script with all includes and compiles it
-open includes - opens all files which are included in current script
-save all and run 1st - saves all changed files and starts first script

best regards
*** deleted upload - new version added 1.4.2006
Last edited by ferdinad_piatnik on Sat Apr 01, 2006 11:36 pm, edited 1 time in total.
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Unread postby Gerome » Thu Mar 09, 2006 10:07 am

Hi Ferdinand!

ferdinad_piatnik wrote:Hi!

I worked little on my version of "CS30.dll" based FBSL editor.
I like to reuse existing software.
CS30.dll enables "column mode select", window splitting and lot of other
editing possibilities. I included a help page with list of editor keyboard and mouse functions.
My added features are:
-possibility to open multiple files
-detecting of supported file types(fbs/inc,htm/html,xml,c,pas,bas,sql,java/js)
-compile with includes - merges script with all includes and compiles it
-open includes - opens all files which are included in current script
-save all and run 1st - saves all changed files and starts first script

best regards


What great evolutions since your first attempt!
Great job, i really appreciate this newest version + ideas you're projecting!

Keep up your good work!
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

MDI editor problems

Unread postby ferdinad_piatnik » Thu Mar 16, 2006 11:34 pm

Hi!

I'm trying to make MDI version of "myEdit" editor. I'm perfectly aware that I'm the only user of it - but let it be. It serves me well and it's under my control. I'm just not able to follow Mike's superior code in his editor and customize it to my needs and wishes.

While working in my small garden I have few serious problems.

1. I don't know how to implement toolbar with icons on MDI frame. If I use Fbsl_Control("ToolbarWindow32",... then the window/control is created in the MDI client window(area) where it competes for space with MDI child windows. And I don't know how to intercept any clicks on icons on that toolbar. I can display icons (with a lot of funny behavior) but I don't know how to put them in use.

Menues - added with AppendMenu function - work fine.
To me it looks like they are created in MDI frame window and not in the MDI client window.

I'm trying to talk about objects described on
URL


Code: Select all
---
Frame, Client, and Child Windows
An MDI application has three kinds of windows: a frame window, an MDI client window, as well as a number of child windows.
---


2. In my program the WindowListSubmenu is not maintained properly(read this: as I expect). After closing MDI child window(with Destroy function) it remains in the list. And after closing all the child windows, new child windows don't appear on the list anymore.

3. MDIArrange function doesn't work as supposed/I expect.

4. If any of child windows is minimized then MDI client window is not
resized with the MDI frame.

It is very possible that this behavior is caused by improper code, but I'm unable to find the cause. The example in FBSL help works perfect.

I'd like to know if it is possible to use toolbar with icons in MDI window. I mean toolbar on MDI frame (top window) - not on MDI child windows.

Best regards

*** I deleted uploaded code to conserve space, in later post i presented smaller, cleaner example of problem ***
Last edited by ferdinad_piatnik on Fri Mar 17, 2006 5:31 pm, edited 1 time in total.
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Unread postby entech » Fri Mar 17, 2006 1:05 am

Along with listview i think MDI was never really finished off by MS. Child windows inherit from the parent, so the menu is common to all children, there are a couple of things about creating and destroying that sometimes create problems. personally i think it is too much effort for too little gain.
david
User avatar
entech
FBSL geek
FBSL geek
 
Posts: 203
Joined: Wed Nov 23, 2005 12:20 am

Unread postby AcE » Fri Mar 17, 2006 10:20 am

Hi !

Can you add a Screenshot on the start post ;)
, for other guys on the board :D

Thks a lot

Good day
User avatar
AcE
FBSL Webmaster
FBSL Webmaster
 
Posts: 42
Joined: Sat Mar 12, 2005 8:33 pm
Location: France

Unread postby Gerome » Fri Mar 17, 2006 10:41 am

Hello,

AcE wrote:Hi !

Can you add a Screenshot on the start post ;)
, for other guys on the board :D

Thks a lot

Good day


No Ace, no screenshots because it is changing a lot, else a ti,y screen with a size < to 40 kb but not big one please, i have few disk space available!!!
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

Simple demonstration of problems

Unread postby ferdinad_piatnik » Fri Mar 17, 2006 2:44 pm

Hi!

Here is very simplified example which shows the problems!
Maybe someone can show me solution.

Best regards

Code: Select all
$AppType MDI
'$AppType console
#Option Explicit
Begin Enum
   ID_New = 101
    ID_TileHorizontal
    ID_TileVertical
    ID_Cascade
    ID_ArrangeIcons
   ID_Close
End Enum
Dim %no=0
Dim %MainMenu = CreateMenu()
Dim %FileMenu = CreateMenu()
Dim %WindowMenu = CreateMenu()
AppendMenu(FileMenu, MF_STRING, ID_New, "&New")
AppendMenu(WindowMenu, MF_STRING, ID_TileHorizontal, "Tile &Horizontal")
AppendMenu(WindowMenu, MF_STRING, ID_TileVertical, "Tile &Vertical")
AppendMenu(WindowMenu, MF_STRING, ID_Cascade, "&Cascade")
AppendMenu(WindowMenu, MF_STRING, ID_ArrangeIcons , "&Arrange Icons")
AppendMenu(MainMenu, MF_POPUP, FileMenu, "&File")
AppendMenu(MainMenu, MF_POPUP, WindowMenu, "&Window")

MDIForm("My MDI Form", 100, 100, 600, 400, MainMenu, WindowMenu)
Dim %myToolbar=Fbsl_Control("ToolbarWindow32", Me, "", 0, 2,2, 596,30, WS_CHILD + WS_VISIBLE , 0)
Dim %myButton=Fbsl_Control("Button", myToolbar, "Close", ID_Close, 2,2, 60,26,WS_CHILD + WS_TABSTOP + WS_VISIBLE + BS_DEFPUSHBUTTON, WS_EX_TRANSPARENT )

Center(Me)
Show(Me)

Begin Events
    Select Case CBMSG
      Case WM_SIZE
          myResize(CBHWND)
      Case WM_CLOSE
         myClose(CBHWND)
      Case WM_COMMAND
            If CBLPARAM = 0 Then
                Select Case CBWPARAM 
                      Case ID_New
                       MDIChildForm("Child " & incr(no)) 
                   Case ID_TileHorizontal
                       MDITile(MDITILE_HORIZONTAL BOR MDITILE_SKIPDISABLED)
                   Case ID_TileVertical
                       MDITile(MDITILE_VERTICAL BOR MDITILE_SKIPDISABLED)
                   Case ID_Cascade
                       MDICascade(MDITILE_SKIPDISABLED)
                   Case ID_ArrangeIcons
                       MDIArrange()
                   Case ID_Close
                      myClose(Me)
                End Select
            End If
    End Select
End Events
'*********** EVENT Handlers *********************************
function myClose(byVal %winHandle)
   If winHandle<>Me Then
      MsgBox(Null, "Closing child",_
                "Close", MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL )
      Destroy(winHandle)
   Else       
      MsgBox(Null, "Exiting main program",_
                "Exit", MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL )
      ExitProgram(0)
   End If
end function
'***********************************************
Function myResize(byVal %winHandle=Me)
   Dim %TopWin, %leftWin,%RightWin, %BottomWin
   GetClientRect(winHandle, TopWin, leftWin, RightWin, BottomWin )
   If winHandle=Me Then   
      Resize(myToolbar, 2,2,RightWin-4, 30)
      MDIArrange()
   Else       
      MsgBox(Null, "Resizing child",_
                "Resize", MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL )
   End If 
End Function
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Unread postby Mike Lobanovsky » Fri Mar 17, 2006 3:01 pm

Dear David,

You are not very correct. The automatic MDI interface Windows offers is perfectly suited for its purpose. Please don't mix VB MDI structure and Windows MDI. VB's one is far more complex but it's by an order of magnitude slower in its response and redrawing/resizing speed. Please read below.

Dear Ferdinand,

Your code is too bloated now to debug. The FBSL MDI structure as we have it today is fully automatic. The automatic Windows MDI structure does not support any additional direct descendants except the MDI client window. This means that in order to maintain the automatic resizing of its client, the MDI frame MUST NOT have any toolbars, status bars, and any other panels except its client window.

As soon as any of these are introduced, the client loses its ability to automatically resize to fit the frame. The frame must have its own routine to rearrange the new descendants and size the client accordingly. The routine CAN be added to the user's script, but my aim is to automate all this within the FBSL source code so that the user doesn't have any additional headaches.

I've found the way to automate resizing of 1 toolbar (wrappable or not) and 1 status bar if they are added to the MDI frame (MDIForm). No rebars or side panels are supported yet.

I'm currently adding quite a few drawing primitives to the FBSL syntax and as soon as I'm through with this, Gerome will post a new build (I hope this will be on Monday).

I prepared a short MDI template for you to learn how to properly create and handle a standard toolbar. I'll post it here when the new build is out.

You'll add the code from your editor to this template little by little and debug it and proceed only after the previous debugging is over. You'll notify us about your progress and we'll help if you need it.

It'll be the most constructive way to debug your editor code. So far it's almost inoperative, sorry.

Mike
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Unread postby ferdinad_piatnik » Fri Mar 17, 2006 5:29 pm

Mike Lobanovsky wrote:Dear Ferdinand,
...

I've found the way to automate resizing of 1 toolbar (wrappable or not) and 1 status bar if they are added to the MDI frame (MDIForm). No rebars or side panels are supported yet.

I'm currently adding quite a few drawing primitives to the FBSL syntax and as soon as I'm through with this, Gerome will post a new build (I hope this will be on Monday).

I prepared a short MDI template for you to learn how to properly create and handle a standard toolbar. I'll post it here when the new build is out.


Great! I expected that the story about MDI was in some early phase and you have more in your pocket. What I've read about handling Windows MDI (on msdn site) is way too complicated for me.

Mike Lobanovsky wrote:You'll add the code from your editor to this template little by little and debug it and proceed only after the previous debugging is over. You'll notify us about your progress and we'll help if you need it.

It'll be the most constructive way to debug your editor code. So far it's almost inoperative, sorry.

Mike


I agree! The code is badly structured. Partly because I'm not comfortable with GUI, I started to rewrite existing code and I haven't found the right writing style yet. I just add a peace here and there.

I prepared small example(based on FBSL MDI help) which reveals the problems I have. I posted it just before you did. I should've done it that way in the beginning. I appologize. It really makes no sense digging through hundreds of lines of undocumented code.

Best regards
User avatar
ferdinad_piatnik
FBSL geek
FBSL geek
 
Posts: 139
Joined: Wed Feb 01, 2006 11:12 pm
Location: Slovenia

Unread postby entech » Sat Mar 18, 2006 12:31 am

Please don't mix VB MDI structure and Windows MDI.
. Ok I guess it would have been an early version of VB i was thinking of. I remember something about adding children and removing them in reverse order as the program was shut down.
david
User avatar
entech
FBSL geek
FBSL geek
 
Posts: 203
Joined: Wed Nov 23, 2005 12:20 am

Unread postby Mike Lobanovsky » Mon Mar 20, 2006 12:55 pm

Hi folks,

Be patient a little and you'll get the following at your disposal (plus a handful of VB-like typing, positioning and drawing functions):
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Next

Return to FBSL v3 Editors

Who is online

Users browsing this forum: No registered users and 1 guest

cron