Login
Username:

Password:


Lost Password?

Register now!
Main Menu
Who's Online
25 user(s) are online (23 user(s) are browsing Forum)

Members: 2
Guests: 23

vidarh, deadwood, more...

Browsing this Thread:   1 Anonymous Users



(1) 2 »


[Zune] I cant move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
Is this options [to move the window] not implemented in Zune?
I tried, but the window dosent move.
I used this two methods to drag:
1] SetAtts (dynamic)
2] And inside the creation of window (static)

Posted on: 2006/3/12 6:39

Edited by camelek on 2006/3/12 6:58:17
_________________
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2005/8/17 15:57
From Germany
Group:
Registered Users
Posts: 1322
Level : 31
HP : 152 / 760
MP : 440 / 11244
EXP : 40
Offline
Please, show us the line of code which you use to move your window.

Posted on: 2006/3/12 11:16
_________________
AROS - Make code, not war
Create PDF from Post Print


Re: [Zune] I can move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
sorry ;P

Now i know what i doing wrong :]

The window cannot be moved, if there is Title after.
[in static]

But in dynamic version this dosent work:


#include<aros/debug.h>
#include <exec/types.h>
#include <dos/dos.h>
#include <proto/exec.h>
#include <proto/muimaster.h>
#include <libraries/mui.h>

Object *app, *wnd, *przycisk, *noweOkno[1024];
    
int tyleOkienekZostanieUruchomionych=1200tyleMBpotrzebujemy=(90*(10^5));

//Tutaj tworzymy hook, który jest nam potrzebny do wykorzystywania funkcji w Zune
struct Hook nasz_hook;

// Tworzymy funkcj&#281;
AROS_UFH2(voidnasz_function,
    
AROS_UFHA(struct Hook *, hA0),
    
AROS_UFHA(char **, stringsA2))
{
AROS_USERFUNC_INIT
#ifndef XILICZNIK
int x=0;
#define XILICZNIK
#endif

x++;

SetAttrs(noweOkno[x], MUIA_Window_LeftEdge,    2*xTAG_END);

    
noweOkno[x] = MUI_NewObject (MUIC_Window,
        
MUIA_Window_Title, (LONG)"Kolejne okno",
            
MUIA_Window_RootObjectMUI_NewObject (MUIC_Group,
                
MUIA_Group_ChildMUI_NewObject (MUIC_Text,
                
MUIA_FrameMUIV_Frame_Text,
                
MUIA_BackgroundMUII_TextBack,
                    
MUIA_Text_Contents, (LONG)"Kolejne okno otwarte",
                
TAG_END),
            
TAG_END),
    
TAG_END);

    if (
noweOkno[x])
    {
    
DoMethod (appOM_ADDMEMBERnoweOkno[x]);
    
    
// Ustawiamy okienko, tak, &#380;e jak zamkniemy, które&#347; z nich, to automatycznie zamknie si&#281; ca&#322;a aplikacja
    
DoMethod (noweOkno[x], MUIM_NotifyMUIA_Window_CloseRequestTRUE
    (
IPTR)app2,
    
MUIM_Application_ReturnIDMUIV_Application_ReturnID_Quit );

    
// Powstrzymujemy okienko, przed uaktywnianiem si&#281;
    
SetAttrs (noweOkno[x], MUIA_Window_ActivateFALSETAG_END);

    
// Oczywi&#347;cie je uruchamiamy
    
SetAttrs (noweOkno[x], MUIA_Window_OpenTRUETAG_END);
    }

AROS_USERFUNC_EXIT
}


LONG ileTejPamieciJest(viod)
{
return(
AvailMem(MEMF_ANY));
}


int main(void)
{

    
// Podajemy jak nazywa si&#281; ta nasza funkcja, i przypisujemy j&#261;
    
nasz_hook.h_Entry = (APTR)nasz_function;

    
app ApplicationObject,
        
SubWindowwnd WindowObject,
        
MUIA_Window_LeftEdge,    100,
        
MUIA_Window_Title"Otwieranie wielu okienek",
        
MUIA_Window_ActivateTRUE,
        
WindowContents,HGroup,
        
Childprzycisk SimpleButton("Otwórz kolejne okno"),
        
End,End,

    
End;

ULONG licznik=0sigs 0;

    if (
app)
    {

    
DoMethod wndMUIM_NotifyMUIA_Window_CloseRequestTRUE
        (
IPTR)app2,
        
MUIM_Application_ReturnIDMUIV_Application_ReturnID_Quit );


    
DoMethod wndMUIM_NotifyMUIA_Window_CloseRequestTRUE
        (
IPTR)app2,
        
MUIM_Application_ReturnIDMUIV_Application_ReturnID_Quit );


    
// I wreszcie mo&#380;emy wykorzysta&#263; nasz&#261; funkcj&#281;
    
DoMethod(przyciskMUIM_NotifyMUIA_PressedFALSE,
        (
IPTR)app2,
        
MUIM_CallHook, (IPTR)&nasz_hook);

    
set(wnd,MUIA_Window_Open,TRUE);

        while (
DoMethod(appMUIM_Application_NewInput, (IPTR) &sigs) != MUIV_Application_ReturnID_Quit)
        {
            while(
licznik<tyleOkienekZostanieUruchomionych)
            {
            
licznik++;
            if(
ileTejPamieciJest()>tyleMBpotrzebujemynasz_function(NULLNULL);
            }
            if (
sigs)
            {
            
sigs Wait(sigs SIGBREAKF_CTRL_C SIGBREAKF_CTRL_D);
            if (
sigs SIGBREAKF_CTRL_C) break;
            if (
sigs SIGBREAKF_CTRL_D) break;
            }
        }    

    
MUI_DisposeObject(app);
    }

return(
0);
}

Posted on: 2006/3/12 12:22

Edited by falemagn on 2006/3/18 3:25:56
_________________
Create PDF from Post Print


Re: [Zune] I can move my window!
Home away from home
Joined:
2005/8/17 15:57
From Germany
Group:
Registered Users
Posts: 1322
Level : 31
HP : 152 / 760
MP : 440 / 11244
EXP : 40
Offline
> #ifndef XILICZNIK
> int x=0;
> #define XILICZNIK
> #endif

Do you want to increase x every time your hook is called? Then you should just write:
static int x=0;

> x++;

> SetAttrs(noweOkno[x], MUIA_Window_LeftEdge, 2*x,
> TAG_END);

> noweOkno[x] = MUI_NewObject (MUIC_Window,
> MUIA_Window_Title, (LONG)"Kolejne okno",
> MUIA_Window_RootObject,

What do you want to do? You are trying to move a non existing window and then you are creating it. Your are calling the hook in a loop. This means you are creating a new window every time you call the hook.

Posted on: 2006/3/12 14:03
_________________
AROS - Make code, not war
Create PDF from Post Print


Re: [Zune] I can move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
Quote:

Mazze wrote:
This means you are creating a new window every time you call the hook.


Yes this program is doing that, but even if i put the moving function after the creating the window this dosent work.

Posted on: 2006/3/13 11:24
_________________
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
Please test that, and show me the right way.

Posted on: 2006/3/13 11:25
_________________
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2005/8/17 15:57
From Germany
Group:
Registered Users
Posts: 1322
Level : 31
HP : 152 / 760
MP : 440 / 11244
EXP : 40
Offline
I don't know very much about MUI.

But when you look in the MUI autodocs for the window class:

MUIA_Window_LeftEdge -- (V4 ) [I.G], LONG

"I" stands for "init" and "G" stands for "get". There is no "S" for set. This means you can't change the LeftEdge attribute with SetAttrs. I don't know if there is another way.


Object 
*app, *wnd, *przycisk, *noweOkno[1024];
int tyleOkienekZostanieUruchomionych=1000tyleMBpotrzebujemy=(90*(10^5));

//Tutaj tworzymy hook, który jest nam potrzebny do wykorzystywania funkcji w Zune
struct Hook nasz_hook;

// Tworzymy funkcj¿
AROS_UFH2(voidnasz_function,
AROS_UFHA(struct Hook *, hA0),
AROS_UFHA(char **, stringsA2))
{
    
AROS_USERFUNC_INIT

    
static int x=0;

    
noweOkno[x] = MUI_NewObject (MUIC_Window,
        
MUIA_Window_Title, (LONG)"Kolejne okno",
        
MUIA_Window_LeftEdgex*2,
        
MUIA_Window_RootObjectMUI_NewObject (MUIC_Group,
        
MUIA_Group_ChildMUI_NewObject (MUIC_Text,
            
MUIA_FrameMUIV_Frame_Text,
            
MUIA_BackgroundMUII_TextBack,
            
MUIA_Text_Contents, (LONG)"Kolejne okno otwarte",
            
TAG_END),
        
TAG_END),
        
TAG_END);

    if (
noweOkno[x])
    {
    
DoMethod (appOM_ADDMEMBERnoweOkno[x]);

    
// Ustawiamy okienko, tak, ¿e jak zamkniemy, które¿ z nich, to automatycznie zamknie si¿ ca¿a aplikacja
    
DoMethod (noweOkno[x], MUIM_NotifyMUIA_Window_CloseRequestTRUE,
        (
IPTR)app2,
        
MUIM_Application_ReturnIDMUIV_Application_ReturnID_Quit );

    
// Powstrzymujemy okienko, przed uaktywnianiem si¿
    
SetAttrs (noweOkno[x], MUIA_Window_ActivateFALSETAG_END);

    
// Oczywi¿cie je uruchamiamy
    
SetAttrs (noweOkno[x], MUIA_Window_OpenTRUETAG_END);
    }
    
x++;

    
AROS_USERFUNC_EXIT

}


I have decreased the value of tyleOkienekZostanieUruchomionych because *noweOkno[1024] can only store 1024 windows.

Posted on: 2006/3/13 13:43
_________________
AROS - Make code, not war
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
Yes you have right i forgot to change that *noweOkno[1024];

The dynamic move in Zune, mayby can be made with Intuition?

Posted on: 2006/3/14 4:02
_________________
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2005/8/17 15:57
From Germany
Group:
Registered Users
Posts: 1322
Level : 31
HP : 152 / 760
MP : 440 / 11244
EXP : 40
Offline
Quote:

Camelek wrote:

The dynamic move in Zune, mayby can be made with Intuition?


You can query the window address with MUIA_Window_Window and then use Intuition functions. I don't know if this is really allowed. I think moving is possible because the FKey commodity does it, too.

Posted on: 2006/3/18 1:59
_________________
AROS - Make code, not war
Create PDF from Post Print


Re: [Zune] I cant move my window!
Home away from home
Joined:
2006/1/26 20:07
From Poland/Belchatow || Polska/Be?chatów || Look on Frappr
Group:
Registered Users
Posts: 168
Level : 12
HP : 0 / 275
MP : 56 / 3715
EXP : 1
Offline
Yes the dynamic move is possible in Zune, but that example [FKey] are using something, that in my case is not allowed.
In FKey is used active window. In my program i open windows with noactive option, because when is opened with active user cannot do something else or is hard to do something.

Posted on: 2006/3/18 11:34
_________________
Create PDF from Post Print



(1) 2 »




Post Reply
Account*
Name   Password   Login 
Message:*


You cannot start a new topic.
You can view topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]


Search
Top Posters
1
paolone
2123
2
nikolaos
1751
3
damocles
1694
4
clusteruk
1327
5
mazze
1322
6
deadwood
1163
7
JLF65
1009
8
Manu
987
9
Kalamatee
868
10
phoenixkonsole
776