Re: [Iup-users] Scintilla issue

2019-06-05 Thread Johann Philippe via Iup-users
 That's good to know ! 
Thanks

Le mercredi 5 juin 2019 à 18:07:17 UTC+2, Antonio Scuri 
 a écrit :  
 
   Hi,
  Some attributes are actually set at the native control after the element is 
mapped. But before map they are stored until map is performed, so almost 
nothing is lost. Almost because the order is lost, when the element is mapped 
the stored attributes are set at the native elements but not in any particular 
order. So some attributes that depends on others, specially for complex 
controls such as IupTree, IupMatrix, and IupScintilla, can fail because of the 
order they are set. The proper way is just like you did, set them after map, 
doing inside map_cb is the most common way.
Best,Scuri

Em qua, 5 de jun de 2019 às 10:53, Johann Philippe  
escreveu:

 I could make it work by setting the attributes after scintilla is mapped, 
inside the MAP_CB. It seems that only some of them were working when i was 
setting the attributes before mapping, but now (with the exact same set of 
IupSetAttribute code in the map_cb) all of them are working.So, not an issue 
anymore.

Le mardi 4 juin 2019 à 22:32:34 UTC+2, Antonio Scuri 
 a écrit :  
 
   Hi,

  I would recommend you to take a look at the IupLuaScripterDlg code in the 
folder "iup\srclua5\scripter". It uses different colors for some fgcolor styles.

  IUP works very close with the Scintilla specs, so each IUP attribute is 
almost a direct map to a Scintilla message. You can also take a look at the 
Scintilla documentation:
https://www.scintilla.org/ScintillaDoc.html 
Best,Scuri

Em ter, 4 de jun de 2019 às 14:12, Johann Philippe via Iup-users 
 escreveu:

Hello, 
I'm using IupScintilla today, and i'm having some issues with the 
autocompletion. 
I copied the example code to my cpp project, and it seems that the STYLEFGCOLOR 
only works on the 
10th style. So, operators have the right color, but everything else is black. 
I tried to put the STYLEBGCOLOR5 to 255 0 255 and it works (the keywords have a 
bg color)... so it seems related only to the STYLEFGCOLOR attribute. 
Any idea ? 
Thanks
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

  
  ___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] Scintilla issue

2019-06-05 Thread Antonio Scuri
  Hi,

  Some attributes are actually set at the native control after the element
is mapped. But before map they are stored until map is performed, so almost
nothing is lost. Almost because the order is lost, when the element is
mapped the stored attributes are set at the native elements but not in any
particular order. So some attributes that depends on others, specially for
complex controls such as IupTree, IupMatrix, and IupScintilla, can fail
because of the order they are set. The proper way is just like you did, set
them after map, doing inside map_cb is the most common way.

Best,
Scuri


Em qua, 5 de jun de 2019 às 10:53, Johann Philippe 
escreveu:

> I could make it work by setting the attributes after scintilla is mapped,
> inside the MAP_CB. It seems that only some of them were working when i was
> setting the attributes before mapping, but now (with the exact same set of
> IupSetAttribute code in the map_cb) all of them are working.
> So, not an issue anymore.
>
> Le mardi 4 juin 2019 à 22:32:34 UTC+2, Antonio Scuri <
> antonio.sc...@gmail.com> a écrit :
>
>
>   Hi,
>
>   I would recommend you to take a look at the IupLuaScripterDlg code in
> the folder "iup\srclua5\scripter". It uses different colors for some
> fgcolor styles.
>
>   IUP works very close with the Scintilla specs, so each IUP attribute is
> almost a direct map to a Scintilla message. You can also take a look at the
> Scintilla documentation:
>
> https://www.scintilla.org/ScintillaDoc.html
>
> Best,
> Scuri
>
>
> Em ter, 4 de jun de 2019 às 14:12, Johann Philippe via Iup-users <
> iup-users@lists.sourceforge.net> escreveu:
>
> Hello,
> I'm using IupScintilla today, and i'm having some issues with the
> autocompletion.
> I copied the example code to my cpp project, and it seems that the
> STYLEFGCOLOR only works on the
> 10th style. So, operators have the right color, but everything else is
> black.
> I tried to put the STYLEBGCOLOR5 to 255 0 255 and it works (the keywords
> have a bg color)... so it seems related only to the STYLEFGCOLOR attribute.
> Any idea ?
> Thanks
> ___
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


[Iup-users] Performance optimize in function winButtonWmCommand.

2019-06-05 Thread Ranier VF
Hi,
Here some performance optimize in function winButtonWmCommand.
The "_IUPBUT_INSIDE_ACTION" is not used anywhere else and can
changed by much faster C resource.

--- \dll\iup\a\src\win\iupwin_button.c  Mon Jun 03 20:25:39 2019
+++ iupwin_button.c Wed Jun 05 10:58:31 2019
@@ -660,21 +660,17 @@
  so we added a test here also */
   if (iupAttribGetBoolean(ih, "CANFOCUS"))
   {
+static int inside_action = 0;
 Icallback cb = IupGetCallback(ih, "ACTION");
 if (cb)
 {
   /* to avoid double calls when pressing enter and a dialog is 
displayed */
-  if (!iupAttribGet(ih, "_IUPBUT_INSIDE_ACTION"))  
+  if (!inside_action)  
   {
-int ret;
-iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", "1");
-
-ret = cb(ih);
-if (ret == IUP_CLOSE)
+inside_action = 1;
+if (cb(ih) == IUP_CLOSE)
   IupExitLoop();
-
-if (ret!=IUP_IGNORE && iupObjectCheck(ih))
-  iupAttribSet(ih, "_IUPBUT_INSIDE_ACTION", NULL);
+inside_action = 0;
   }
 }
   }

Best regards,
Ranier Vilela

iupwin_button.c.patch
Description: iupwin_button.c.patch
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users


Re: [Iup-users] Scintilla issue

2019-06-05 Thread Johann Philippe via Iup-users
 I could make it work by setting the attributes after scintilla is mapped, 
inside the MAP_CB. It seems that only some of them were working when i was 
setting the attributes before mapping, but now (with the exact same set of 
IupSetAttribute code in the map_cb) all of them are working.So, not an issue 
anymore.

Le mardi 4 juin 2019 à 22:32:34 UTC+2, Antonio Scuri 
 a écrit :  
 
   Hi,

  I would recommend you to take a look at the IupLuaScripterDlg code in the 
folder "iup\srclua5\scripter". It uses different colors for some fgcolor styles.

  IUP works very close with the Scintilla specs, so each IUP attribute is 
almost a direct map to a Scintilla message. You can also take a look at the 
Scintilla documentation:
https://www.scintilla.org/ScintillaDoc.html 
Best,Scuri

Em ter, 4 de jun de 2019 às 14:12, Johann Philippe via Iup-users 
 escreveu:

Hello, 
I'm using IupScintilla today, and i'm having some issues with the 
autocompletion. 
I copied the example code to my cpp project, and it seems that the STYLEFGCOLOR 
only works on the 
10th style. So, operators have the right color, but everything else is black. 
I tried to put the STYLEBGCOLOR5 to 255 0 255 and it works (the keywords have a 
bg color)... so it seems related only to the STYLEFGCOLOR attribute. 
Any idea ? 
Thanks
___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

  ___
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users