1. Edita Requests

Edita Requests

The stop lite goes out when .dat files are selected.

This is good.

I would like see it go out unless a .exw, ,ex or .exu program is selected.

Furthermore I would like to see the tabs (mine are at the bottom) color coded 
in the following manner.

.ex .exw .exu --green tinted Buttonface

.e .ew .eu --yellow tinted Buttonface

.doc .dat --Buttonface


I found that colors can be mixed with Buttonface color like so.

 rgb(227,220,166)) --color yellow tinted Buttonface
 rgb(219,188,183)) --pink Buttonface
 rgb(206,225,193)) --green tinted Buttonface
 
 I believe Judith's Colored Buttons would do the trick.
 I've used them successfully with Buttons and Win32lib.
 
 So it should work with Tabs and Arwin.
 
    I remember a while back (with your help of course) that I was getting 
 the background of the Tab text to change colors. Although I would prefer that
 the whole Tab to change colors, this would be sufficient for my purpose.
 
I fact as soon as I finish what I am doing, I'm going to go back to work on
    this.
 
 I think Edita would look really cool if one could discern the 
type of file that was open by the color of it's Tab.
 

Don Cole

new topic     » topic index » view message » categorize

2. Re: Edita Requests

don cole wrote:
> 
> Edita Requests
> 
> The stop lite goes out when .dat files are selected.
> 
> This is good.
> 
> I would like see it go out unless a .exw, ,ex or .exu program is selected.
> 
It pretty much does that anyway???
Prompted by this, I did just change eamenus.ew, ~line 535 from:
ext = getFileExtension(filenames[currfile])
	if find(ext,{"ex","exw","exwc","htm","html","bat"})
	or (equal(ext,"") and match(untitled,filenames[currfile])=1) then

to just:
if find(getFileExtension(filenames[currfile]),
		{"ex","exw","exwc","htm","html","bat"}) then

Since there is little point having the Run button enabled for "[untitled]" and
hence unsaved filetabs, but otherwise I don't get what you mean.

It seems wrong to enable the run button for exu files on a Windows machine.
I run html and bat files from Edita all the time, no problem there either.

> Furthermore I would like to see the tabs (mine are at the bottom) color coded
> 
> in the following manner.
> 
> .ex .exw .exu --green tinted Buttonface
> 
> .e .ew .eu --yellow tinted Buttonface
> 
> .doc .dat --Buttonface
> 
> 
> I found that colors can be mixed with Buttonface color like so.
> 
>  rgb(227,220,166)) --color yellow tinted Buttonface
>  rgb(219,188,183)) --pink Buttonface
>  rgb(206,225,193)) --green tinted Buttonface
>  
>  I believe Judith's Colored Buttons would do the trick.
>  I've used them successfully with Buttons and Win32lib.
>  
>  So it should work with Tabs and Arwin.
WHOA! As you look at the 2380 lines of code that is ColouredButtons.ew, recall
that is for single static buttons - think how much more complicated all that line
drawing would be on a TCS_MULTILINE tab bar!

Anyway, I figured somthing else out:
>  
>     I remember a while back (with your help of course) that I was getting 
>  the background of the Tab text to change colors. Although I would prefer that
>  the whole Tab to change colors, this would be sufficient for my purpose.
>  
I don't recall that exactly, but I had a quick ten-minute play and found this
worked reasonably well on arwen's demo_tabs.ew. In procedure drawTabItems, ~line
4870, replace:
if and_bits(state, ODS_SELECTED) then
	void = c_func(xFillRect, {hDC, lpRect, COLOR_MENU+1})

with:
colour = ObjectBackColour[id]
    if colour=UNDEFINED then
	colour=COLOR_MENU+1
    end if
    void = c_func(xSetBkColor, {hDC, colour} )
    void = c_func(xSetBkMode, {hDC, TRANSPARENT} )
    void = c_func(xFillRect, {hDC, lpRect, colour})
    -- if the tab is selected then (i) blank the background and (ii) 
reposition text higher
    if and_bits(state, ODS_SELECTED) then
--	void = c_func(xFillRect, {hDC, lpRect, COLOR_MENU+1})

Also in arwen.ew, after procedure setTextColour, add:
global procedure setBackColour(integer id, integer colour)
    ObjectBackColour[id] = colour
    repaintWindow(id)
end procedure

global function getBackColour(integer id)
    return ObjectBackColour[id]
end function


Then finally, in demo_tabs itself, I added:
setBackColour(TABCONTROL2, c_func(xCreateSolidBrush, {Yellow}))


It might suffer some more tweaks, and definately benefit from use of more subtle
colours, but the basics are there.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: Edita Requests

Pete Lomax wrote:
> 
> It seems wrong to enable the run button for exu files on a Windows machine.
> I run html and bat files from Edita all the time, no problem there either.

Once again, I will strongly disagree with you. :)

An ex, exw or exu could very well be cross platform, especially if it's meant
to be run from the console, or if it's a wxEuphoria program.  I assume that
if the original author's 'home' platform is *nix, he'll use .exu, and if
his 'home' platform is windows, he'll use .exw.

I have wxIDE set up to run (in addition to euphoria) html, dos batch,
perl, python, ruby and wxbasic.  There's also the capability to set up 
an alternate euphoria interpreter profile, which has been really helpful 
while working on ooeu.

Matt

new topic     » goto parent     » topic index » view message » categorize

4. Re: Edita Requests

Matt Lewis wrote:
> 
> Pete Lomax wrote:
> > 
> > It seems wrong to enable the run button for exu files on Windows
> 
> Once again, I will strongly disagree with you. :)
> 
> An ex, exw or exu could very well be cross platform, especially if it's meant
> to be run from the console, or if it's a wxEuphoria program.  I assume that
> if the original author's 'home' platform is *nix, he'll use .exu, and if
> his 'home' platform is windows, he'll use .exw.
OK, point taken, exu added.
> 
> I have wxIDE set up to run (in addition to euphoria) html, dos batch,
> perl, python, ruby and wxbasic.  There's also the capability to set up 
> an alternate euphoria interpreter profile, which has been really helpful 
> while working on ooeu.
Edita could do with something a bit like that, though I'd favour setting up the
"interpret with" part once, then allow a list of extensions and an "active?"
checkbox. I assume you have to dive into Options/Custom Interpreter to switch
between perl and python, and/or you get a rack of errors when you forget?

BTW, I thought that was broken. I kept entering a command string and clicking on
OK/Apply and nothing happened or was saved. It seems to be expecting a return,
which is very un-windows-y. I now see it also works if you click on any other
command line input fields (before?) clicking OK/Apply.
I also suffered from:
C:\P2\wx\wxEuphoria\demo\wxIDE.exw:1727 in procedure get_files() 
subscript value 1 is out of bounds, reading from a sequence of length 0 
    files = {
	      "C:\\P2\\wx\\wxEuphoria\\demo\\bench_draw.exw",
	      {},
	      "C:\\P2\\wx\\wxEuphoria\\license\\gpl.txt"
	    }
which I avoided with an "and length(files[i])"... ??

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

5. Re: Edita Requests

Pete Lomax wrote:
> 
> > 
> > I have wxIDE set up to run (in addition to euphoria) html, dos batch,
> > perl, python, ruby and wxbasic.  There's also the capability to set up 
> > an alternate euphoria interpreter profile, which has been really helpful 
> > while working on ooeu.
>
> Edita could do with something a bit like that, though I'd favour setting up
> the "interpret with" part once, then allow a list of extensions and an
> "active?"
> checkbox. I assume you have to dive into Options/Custom Interpreter to switch
> between perl and python, and/or you get a rack of errors when you forget?

It's all stored in the ini file currently, without a way to edit from the
GUI.  You associate an extension with an interpreter.  The alternate 
interpreter thing is there to use with alternate euphoria interpreters.
 
> BTW, I thought that was broken. I kept entering a command string and clicking
> on OK/Apply and nothing happened or was saved. It seems to be expecting a
> return,
> which is very un-windows-y. I now see it also works if you click on any other
> command line input fields (before?) clicking OK/Apply.

Yeah, the wxGrid control is nice, but still leaves some things like that to
be desired.  There's a routine that saves any unsaved edits.  I should 
probably be calling that somewhere in there.

> I also suffered from:
> C:\P2\wx\wxEuphoria\demo\wxIDE.exw:1727 in procedure get_files() 
> subscript value 1 is out of bounds, reading from a sequence of length 0 
>     files = {
> 	      "C:\\P2\\wx\\wxEuphoria\\demo\\bench_draw.exw",
> 	      {},
> 	      "C:\\P2\\wx\\wxEuphoria\\license\\gpl.txt"
> 	    }
> which I avoided with an "and length(files[i])"... ??

Thanks, apparently I hadn't found that bug...

Matt

new topic     » goto parent     » topic index » view message » categorize

6. Re: Edita Requests

Pete Lomax wrote:

<snip>

and found this
> worked reasonably well on arwen's demo_tabs.ew. In procedure drawTabItems, 
  
  Where would I find Arwen's demo_tabs.ew.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

7. Re: Edita Requests

don cole wrote:
> 
> Pete Lomax wrote:
> 
> <snip>
> 
> and found this
> > worked reasonably well on arwen's demo_tabs.ew. In procedure drawTabItems, 
>   
>   Where would I find Arwen's demo_tabs.ew.
> 
> Don Cole
I've posted a full kit (96K zipped, 382K unzipped) at:
http://palacebuilders.pwp.blueyonder.co.uk/dcole.zip

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

8. Re: Edita Requests

Hello Pete,

In order to to what I would like to do, I want to copy a bitmap to the DEMO
   window. And you have most of copyDib remmed out. Any reason for this?
I believe the only way the change to backlground text of a Tab (in Arwin)is to
paste a bimap over it. Is this true?



Don Cole

new topic     » goto parent     » topic index » view message » categorize

9. Re: Edita Requests

don cole wrote:
> 
> Hello Pete,
> 
>    In order to to what I would like to do, I want to copy a bitmap to the DEMO
> window. And you have most of copyDib remmed out. Any reason for this?

The arwen.ew I ship has "include dib256.ew" commented out because edita does not
use it. If anything, the dib256.ew which I (pointlessly) distribute [*] actually
contains some uncommented code over the official that I had a play with, iirc.
Afaik, the copyDib routine has been left exactly how I found it.
Mike has posted a new version of arwen with improved/working dibs. I have yet to
try this out/merge it into something edita can use.
[*] There is nothing to stop anyone, as and when needed, coding:
include arwen.ew
include dib256.ew


BTB,
Are you saying that "dcole.zip" does not work? If so can you send me some
details, eg screen dumps, of what you get, and maybe, edited, what you want?

> I believe the only way the change to backlground text of a Tab (in Arwin)is
> to paste a bimap over it. Is this true?

If you do not want a pattern, then a bitmap offers nothing over FillRect, so no,
I would say that is utterly false. What exactly do you mean by "backlground text"
anyway? Do you mean background? Do you mean text? Or do you mean something
inbetween?

Confused,
Pete

PS It is called arwen, not arwin (maybe you can ask Mike why, maybe it says
somethere in the docs, I forget).

new topic     » goto parent     » topic index » view message » categorize

10. Re: Edita Requests

Pete Lomax wrote:
> 
> don cole wrote:
> > 
> > Hello Pete,
> > 
> >    In order to to what I would like to do, I want to copy a bitmap to the
> >    DEMO
> > window. And you have most of copyDib remmed out. Any reason for this?
> 
> The arwen.ew I ship has "include dib256.ew" commented out because edita does
> not use it. If anything, the dib256.ew which I (pointlessly) distribute [*]
> actually contains some uncommented code over the official that I had a play
> with, iirc. Afaik, the copyDib routine has been left exactly how I found it.
> 
> Mike has posted a new version of arwen with improved/working dibs. I have yet
> to try this out/merge it into something edita can use.
> [*] There is nothing to stop anyone, as and when needed, coding:
> }}}
<eucode>
> include arwen.ew
> include dib256.ew
> </eucode>
{{{

> 
> BTB,
> Are you saying that "dcole.zip" does not work? 

No that works fine. If I change the color of the text with
setTextColour(TABCONTROL2,White). That works ok.

If I change the background with  setBackColour(TABCONTROL2,#FFFFFF). The
background always turns white and text black no matter what color I put in there.

> change  If so can you send me some details,
> eg screen dumps, of what you get, and maybe, edited, what you want?
> 
> > I believe the only way the change to backlground text of a Tab (in Arwin)is
> > to paste a bimap over it. Is this true?
> 
> If you do not want a pattern, then a bitmap offers nothing over FillRect, so
> no, I would say that is utterly false. What exactly do you mean by
> "backlground
> text" anyway? Do you mean background? Do you mean text? Or do you mean
> something
> inbetween?

The text background text would be the color center of the "O".
The background color would be the whole tab except the text.
I would like to change the text background and the Tab background to the same
color. But different colors for each Tab.

Screen shot.

http://www.RapidEuphoria.com/uploads/petes letter.bmp


I want the same as this but with differnt colored Tabs instead of Buttons.

> 
> Confused,
> Pete
> 
> PS It is called arwen, not arwin (maybe you can ask Mike why, maybe it says
> somethere in the docs, I forget).

I don't care why. I'll try Mike's version and see if it will work with
copyDib().

Thanks,

Don Cole

new topic     » goto parent     » topic index » view message » categorize

11. Re: Edita Requests

don cole wrote:
> 
> Pete Lomax wrote:
> > 
> > Are you saying that "dcole.zip" does not work? 
> 
> No that works fine. If I change the color of the text with
> setTextColour(TABCONTROL2,White).
> That works ok.
> 
> If I change the background with  setBackColour(TABCONTROL2,#FFFFFF). The
> background
> always turns white and text black no matter what color I put in there.

That would be because you have rudely deleted the CreateBrush part.

Here is a mod whereby setBackColour() accepts a colourref, which is more natural
and correct than passing a brush anyway, and drawTabItems manages any brushes
needed internally:

Insert before drawTabItems:
sequence drawTabColours, drawTabBrushes
	 drawTabColours={} drawTabBrushes={}
integer k
atom colour,brush


and find the first/last lines of this block in routine drawTabItems() and
replace everything between with:
if colour=UNDEFINED then
	colour=COLOR_MENU+1
	brush=colour
    else
	k = find(colour,drawTabColours)
	if k then
	    brush=drawTabBrushes[k] 
	else
	    drawTabColours=append(drawTabColours,colour)
	    brush=c_func(xCreateSolidBrush, {colour})
	    drawTabBrushes=append(drawTabBrushes,brush)
	end if
    end if
    void = c_func(xSetBkColor, {hDC, colour} )
    void = c_func(xSetBkMode, {hDC, TRANSPARENT} )
--  void = c_func(xFillRect, {hDC, lpRect, colour})
    void = c_func(xFillRect, {hDC, lpRect, brush})
    if and_bits(state, ODS_SELECTED) then
}}}
<eucode>

Regards, Pete }}}

new topic     » goto parent     » topic index » view message » categorize

12. Re: Edita Requests

procedure drawTabItems(atom hDC, --   this I assume is hDc=getDC(TABCONTROL)
                        atom lParam,      --I don't know what to put here
                        atom lpRect,     -- I don't know
                        integer action,  -- I put ODA_DRAWINTIRE
                        integer state)  --  I put ODS_FOCUS 

 end procedure

I get a machine level exception using this routine.;


-- ACTIONS
--ODA_DRAWENTIRE    The entire control needs to be drawn.
--ODA_FOCUS The control has lost or gained the keyboard focus. The itemState
member should be checked to determine whether the control has the focus.
--ODA_SELECT    The selection status has changed. The itemState member should be
checked to determine the new selection state.

-- STATE AFTER ACTION
--ODS_CHECKED   The menu item is to be checked. This bit is used only in a menu.
--ODS_COMBOBOXEDIT  The drawing takes place in the selection field (edit
control) of an ownerdrawn combo box.
--ODS_DEFAULT   The item is the default item.
--ODS_DISABLED  The item is to be drawn as disabled.
--ODS_FOCUS The item has the keyboard focus.
--ODS_GRAYED    The item is to be grayed. This bit is used only in a menu.
--ODS_SELECTED  The menu item's status is selected.

Thanks again Pete. What I am having trouble with is getting the dimensions on
the tabs.

I think this will do if I can get it to work.

Don Cole

new topic     » goto parent     » topic index » view message » categorize

13. Re: Edita Requests

don cole wrote:
> 
>  procedure drawTabItems(atom hDC, --   this I assume is hDc=getDC(TABCONTROL)
>                         atom lParam,      --I don't know what to put here

WHOA! This is an internal arwen routine. Do NOT plonk the word "global" in front
of it and try to call it from application code!

See demo_tabs. You say it works. So why try this???

Pete

new topic     » goto parent     » topic index » view message » categorize

14. Re: Edita Requests

Pete Lomax wrote:
> 
> don cole wrote:
> > 
> > Pete Lomax wrote:
> > > 
> > > Are you saying that "dcole.zip" does not work? 
> > 
> > No that works fine. If I change the color of the text with
> > setTextColour(TABCONTROL2,White).
> > That works ok.
> > 
> > If I change the background with  setBackColour(TABCONTROL2,#FFFFFF). The
> > background
> > always turns white and text black no matter what color I put in there.
> 
> That would be because you have rudely deleted the CreateBrush part.
> 
> Here is a mod whereby setBackColour() accepts a colourref, which is more
> natural
> and correct than passing a brush anyway, and drawTabItems manages any brushes
> needed internally:
> 
> Insert before drawTabItems:

Do you mean insert this outside of the drawTabItems() procedure?

> }}}
<eucode>
> sequence drawTabColours, drawTabBrushes
> 	 drawTabColours={} drawTabBrushes={}
> integer k
> atom colour,brush
> </eucode>
{{{

> 
> and find the first/last lines of this block in routine drawTabItems() and
> replace
> everything between with:
> }}}
<eucode>
>     if colour=UNDEFINED then
> 	colour=COLOR_MENU+1
> 	brush=colour
>     else
> 	k = find(colour,drawTabColours)
> 	if k then
> 	    brush=drawTabBrushes[k] 
> 	else
> 	    drawTabColours=append(drawTabColours,colour)
> 	    brush=c_func(xCreateSolidBrush, {colour})
> 	    drawTabBrushes=append(drawTabBrushes,brush)
> 	end if
>     end if

   If I insert colour = Yellow here it works, all tabs turn backgroung yellow.

But I can't figure out how to send the back ground color over from the demo.
I'm not sure how to change background of each tab individually 
I'm sure it has to do with ObjectChildren[id].

>     void = c_func(xSetBkColor, {hDC, colour} )
>     void = c_func(xSetBkMode, {hDC, TRANSPARENT} )
> --  void = c_func(xFillRect, {hDC, lpRect, colour})
>     void = c_func(xFillRect, {hDC, lpRect, brush})
>     if and_bits(state, ODS_SELECTED) then
> }}}
<eucode>
> 
> Regards,
> Pete

Hello Pete,

I'm about to give up on this. I've tried you code several ways but I can't
   seem to get the backcolor to work.

If I could get started on this I'm sure I could work out the details.

Thanks for trying,

Don Cole

new topic     » goto parent     » topic index » view message » categorize

15. Re: Edita Requests

don cole wrote:
> 
> I'm about to give up on this. I've tried you code several ways but I
> can't seem to get the backcolor to work.

Just leave it with me; there'll be something in the next version of Edita.
All an application ought need to do is setBackColour(id,Yellow) for each TabItem
in the TabControl. Edita will need:
  * new routines to handle a listview of {extension, command, colour}
  * mods to eamenus to invoke the above
  * mods to eaedb to save/restore this info
  * mods to openFile/shuffleFile to apply this info
  * mods to eacons to use the new command info
Some of the above is part done on the internal version (**ie NOT uploaded and
therefore NOT downloadable yet**) and may take a while to finish.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

16. Re: Edita Requests

Pete Lomax wrote:
> 
> don cole wrote:
> > 
> > I'm about to give up on this. I've tried you code several ways but I
> > can't seem to get the backcolor to work.
> 
> Just leave it with me; there'll be something in the next version of Edita.
> All an application ought need to do is setBackColour(id,Yellow) for each
> TabItem
> in the TabControl. Edita will need:
>   * new routines to handle a listview of {extension, command, colour}
>   * mods to eamenus to invoke the above
>   * mods to eaedb to save/restore this info
>   * mods to openFile/shuffleFile to apply this info
>   * mods to eacons to use the new command info
> Some of the above is part done on the internal version (**ie NOT uploaded and
> therefore NOT downloadable yet**) and may take a while to finish.
> 
> Regards,
> Pete
  You where right again Pete (I should read what you said more slowly).
  I finally got the TabBackColor to work'.
See the screen shot.
http://www.RapidEuphoria.com/uploads/pete2.bmp

If your Edita is anything like mine then you might have 20 files open at once.
It's easier to find the Tab you are looking for if the executable ones are
highlited.

These filenames don't mean anything.  `But the TabBackColour is chosen by the
file extention.

There was some talk about .eu and .html extentions to be added. Any color can be
used for anything I'm going to maker up an easy to read chart.


Don Cole

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu